Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hackish bug fix for hanging connections on large queries

If the query is large, psycopg2 sets async status to WRITE and requires
additional calls to poll() to flush the query to postgresql.  Momoko was
telling tornado to only listen for READ, so poll() was never called and
the query would hang
  • Loading branch information...
commit fbc8b8984b044fc4256fe931737bf71e77ae9ade 1 parent e4bbd17
@stevearc stevearc authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 momoko/pools.py
View
4 momoko/pools.py
@@ -318,8 +318,8 @@ def cursor(self, function, function_args, callback, cursor_kwargs={}):
getattr(cursor, function)(*function_args)
self._callbacks = [partial(callback, cursor)]
- # Connection state should be 1 (write)
- self._ioloop.update_handler(self._fileno, IOLoop.READ)
+ # Fire callback immediately To correctly set the update handler
+ self._io_callback(None, None)
def _io_callback(self, fd, events):
try:
Please sign in to comment.
Something went wrong with that request. Please try again.