After re-preparing stmts, run query in executor

The query was being resubmitted on the event loop thread,
which could cause a deadlock if there were not any connections
available for use.
This commit is contained in:
Tyler Hobbs
2013-11-04 15:33:19 -06:00
parent cabcc9b6aa
commit 46d1cc1316

View File

@@ -1708,7 +1708,8 @@ class ResponseFuture(object):
return request_id
def _reprepare(self, prepare_message):
request_id = self._query(self._current_host, prepare_message, cb=self._execute_after_prepare)
cb = partial(self.session.submit, self._execute_after_prepare)
request_id = self._query(self._current_host, prepare_message, cb=cb)
if request_id is None:
# try to submit the original prepared statement on some other host
self.send_request()