Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Do not block when connecting socket #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neg3ntropy
Copy link

Hi,
I was running some tests in a Tornado web application that uses tornado-redis after a call to IOLoop.set_blocking_log_threshold() with a low value, to spot any blocking IO or slow sections.

This was the most recurring problem:

  File "build/bdist.linux-x86_64/egg/tornadoredis/client.py", line 405, in execute_command
    self.connection.connect()
  File "build/bdist.linux-x86_64/egg/tornadoredis/connection.py", line 73, in connect
    sock.connect((self.host, self.port))

The connection is in fact opened in blocking mode.

After this patch the problem goes away and my app seems to work.
I did not run any unit test and I am aware that this probably needs some more work, for example on connection errors.

However I urge you to try and fix this and put out a new release as it quite critical to block the IOLoop even for a small time.
Thank you

@leporo
Copy link
Owner

leporo commented Apr 18, 2014

Thanks, I'll see why unit tests are failing.

@AeroNotix
Copy link

@soulrebel can you rebase this PR?

@neg3ntropy
Copy link
Author

Sorry guys, I have now moved to other projects, technologies and even languages to help out on this.

@AeroNotix
Copy link

Good for you.

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

Successfully merging this pull request may close these issues.

5 participants