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

geoipserver hangs, logging output not useful #6

Open
aaaaalbert opened this issue Dec 8, 2014 · 2 comments
Open

geoipserver hangs, logging output not useful #6

aaaaalbert opened this issue Dec 8, 2014 · 2 comments

Comments

@aaaaalbert
Copy link
Contributor

The geoipserver is prone to hangs, and the logging it provides isn't adequate to debug the problem.

From a recent hiccup that left the server hanging intermittently (until I ^C'd one of the threads and thus unblock it):

119.154.168.130 - - [07/Nov/2014 00:19:26] "POST / HTTP/1.0" 200 -
----------------------------------------
Exception happened during processing of request from ('119.154.168.130', 60918)
Traceback (most recent call last):
  File "/usr/lib/python2.5/SocketServer.py", line 222, in handle_request
  File "/usr/lib/python2.5/SocketServer.py", line 241, in process_request
  File "/usr/lib/python2.5/SocketServer.py", line 254, in finish_request
  File "/usr/lib/python2.5/SocketServer.py", line 522, in __init__
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 316, in handle
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 299, in handle_one_request
  File "/usr/lib/python2.5/socket.py", line 346, in readline
KeyboardInterrupt

Also,

blackbox.poly.edu - - [08/Dec/2014 02:50:06] "POST / HTTP/1.0" 200 -
----------------------------------------
Exception happened during processing of request from ('128.238.63.50', 58718)
Traceback (most recent call last):
  File "/usr/lib/python2.5/SocketServer.py", line 222, in handle_request
  File "/usr/lib/python2.5/SocketServer.py", line 241, in process_request
  File "/usr/lib/python2.5/SocketServer.py", line 254, in finish_request
  File "/usr/lib/python2.5/SocketServer.py", line 522, in __init__
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 316, in handle
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
  File "/usr/lib/python2.5/SimpleXMLRPCServer.py", line 477, in do_POST
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 368, in send_response
  File "/usr/lib/python2.5/socket.py", line 262, in write
  File "/usr/lib/python2.5/socket.py", line 249, in flush
error: (32, 'Broken pipe')

Thanks @us341 for debugging support.

@aaaaalbert
Copy link
Contributor Author

Seems like it suffices to connect to the server, e.g. with telnet or netcat, and leave the connection open, but not send anything. This allows further clients to connect still, but blocks off the actual logic (XML-RPC). Yikes.

Potential solutions:

  • Go multi-threaded
  • Implement timeout for clients

aaaaalbert added a commit that referenced this issue Dec 19, 2014
I'm setting a default timout for all sockets used by the
geoip_server. Inspiration: https://stackoverflow.com/questions/372365/set-timeout-for-xmlrpclib-serverproxy

We may still consider making the server multi-threaded, and/or time
out in slightly more elegant (higher-layer) ways.
@aaaaalbert
Copy link
Contributor Author

The problem isn't too prevalent btw. The backup geoip server hung on a connection only last week, ~18 months after the first report of this issue. I've patched it using the "interim fix" from above, i.e. a five second socket timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant