Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

econ socket is not closed on SIGTERM and SIGINT #68

Open
bretonium opened this issue Jan 28, 2019 · 6 comments · May be fixed by #89
Open

econ socket is not closed on SIGTERM and SIGINT #68

bretonium opened this issue Jan 28, 2019 · 6 comments · May be fixed by #89
Labels
bug Something isn't working hard-to-fix This issue is difficult to fix

Comments

@bretonium
Copy link
Collaborator

bretonium commented Jan 28, 2019

When i stop infclass process via SIGINT (in my case i just press Ctrl-C) or SIGTERM (via kill <pid>) econ socket is not getting closed. Because of it, i cannot restart the server immediately and have to wait for 60 seconds.

Steps to reproduce:

  1. Set up the server with econ enabled
# binding to 0.0.0.0 is dangerous, but whatever
ec_bindaddr 0.0.0.0
ec_port 8309
ec_password <password>
ec_output_level 2
  1. Run the server and verify that econ works: (for example, using telnet <ip> 8309, you will see password prompt)
  2. Shutdown the server by pressing Ctrl-C
  3. Start the server again and try connecting to the econ

Expected: connection to econ succeeds
Observed: connection fails; in server log there is message about the server not being able to open a socket

@ResamVi
Copy link
Collaborator

ResamVi commented Jan 29, 2019

I think that this is outside the scope of infclass. Maybe the offical teeworlds repo can get answers?

@bretonium
Copy link
Collaborator Author

We maintain a full disconnected copy of teeworlds code and haven't updated it in many years. Our code is different from theirs right now. Even if it should/was/is being fixed in the teeworlds repo, the fix still needs to be backported to our code manually.

Also, TIL that SIGTERM is not the signal that is sent upon ^C. The signal sent upon ^C is SIGINT. Another thing i learned about is SO_REUSEADDR/SO_REUSEPORT, which is probably what we need. As far as i understand, it should be set somewhere in src/base/system.c before bind(), for example in

@duralakun
Copy link
Collaborator

i dont know much about this, but maybe this helps:
teeworlds/teeworlds#804

@bretonium
Copy link
Collaborator Author

We have this patch applied, it still does not help

@bretonium bretonium changed the title econ socket is not closed on SIGTERM econ socket is not closed on SIGTERM and SIGINT Jan 29, 2019
@teoman002 teoman002 added bug Something isn't working wontfix This will not be worked on labels Feb 1, 2019
@bretonium
Copy link
Collaborator Author

Why does this bug have label "wontfix"?

@teoman002
Copy link
Collaborator

Because no one is able to fix it!
Maybe we need another label for that.

@duralakun duralakun added the hard-to-fix This issue is difficult to fix label Feb 10, 2019
@bretonium bretonium linked a pull request Feb 10, 2019 that will close this issue
@teoman002 teoman002 removed the wontfix This will not be worked on label Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hard-to-fix This issue is difficult to fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants