Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4ea829d

Browse files
committed
Fix eventloop stuck in docker-based tests. aio-libs/aiopg#375
1 parent ad7686d commit 4ea829d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests2/lib/bank_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def status(self):
159159
serialized_aggs[conn_id][aggname] = agg.as_dict()
160160
agg.clear_values()
161161

162-
self.child_pipe.send(serialized_aggs)
162+
yield from self.child_pipe.coro_send(serialized_aggs)
163163
else:
164164
print('evloop: unknown message')
165165

@@ -185,7 +185,11 @@ def exec_tx(self, tx_block, aggname_prefix, conn_i):
185185
print('Connected %s, %d' % (aggname_prefix, conn_i + 1) )
186186

187187
if (not cur) or cur.closed:
188-
cur = yield from conn.cursor(timeout=10)
188+
# big timeout here is important because on timeout
189+
# expiration psycopg tries to call PQcancel() which
190+
# tries to create blocking connection to postgres and
191+
# blocks evloop
192+
cur = yield from conn.cursor(timeout=3600)
189193

190194
# ROLLBACK tx after previous exception.
191195
# Doing this here instead of except handler to stay inside try

0 commit comments

Comments
 (0)