basho / riak-python-client

The Riak client for Python.
Apache License 2.0
321 stars 183 forks source link

READY: Catch environment exceptions when socket.shutdown() is called #462

Closed lukebakken closed 8 years ago

lukebakken commented 8 years ago

Resolves #461 (CLIENTS-837)

lukebakken commented 8 years ago

@javajolt - we never used to call shutdown, which should be called according to the docs. Another option for a fix would be to just remove it altogether.

@Tinche - I would be interested to see if you can test this in your env. I'm also going to try and release 2.5.2b1 soon.

Tinche commented 8 years ago

The fix seems to work, aside from polluting the logs. The exception isn't leaking out any more as far as I can see. Again, this is on OS X, on Linux I'm not seeing this.

Tinche commented 8 years ago

Honestly logging the entire traceback isn't that helpful here. Or maybe logging it at all on such a high level. Generally I don't care if sockets we've already declared defunct can't be closed cleanly. Consider logging it on the debug level?

lukebakken commented 8 years ago

@Tinche good points, I'll log as debug.