Nir Soffer has uploaded a new change for review.
Change subject: betterasynccore: Prevent double close ......................................................................
betterasynccore: Prevent double close
asyncore.dispatcher is defining a closing attribute, but never use it. This make it possible to close a dispatcher multiple times, failing with KeyError after the first call.
Because of the asynchronous nature of the reactor, it is very hard to ensure that all dispatchers are closed before the reactor, so we need a more robust close method.
This patch uses the closing attribute to eliminate double close errors.
Change-Id: Ia293deb79affc2f740d825e24ce8c66449385111 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M lib/yajsonrpc/betterAsyncore.py 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/09/65209/1
diff --git a/lib/yajsonrpc/betterAsyncore.py b/lib/yajsonrpc/betterAsyncore.py index c32b54c..b86c919 100644 --- a/lib/yajsonrpc/betterAsyncore.py +++ b/lib/yajsonrpc/betterAsyncore.py @@ -69,6 +69,12 @@ def handle_write(self): self._delegate_call("handle_write")
+ def close(self): + if self.closing: + return + self.closing = True + asyncore.dispatcher.close(self) + def switch_implementation(self, impl): self.__impl = impl
gerrit-hooks has posted comments on this change.
Change subject: betterasynccore: Prevent double close ......................................................................
Patch Set 1:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: betterasynccore: Prevent double close ......................................................................
betterasynccore: Prevent double close
asyncore.dispatcher is defining a closing attribute, but never use it. This make it possible to close a dispatcher multiple times, failing with KeyError after the first call.
Because of the asynchronous nature of the reactor, it is very hard to ensure that all dispatchers are closed before the reactor, so we need a more robust close method.
This patch uses the closing attribute to eliminate double close errors.
Change-Id: Ia293deb79affc2f740d825e24ce8c66449385111 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M lib/yajsonrpc/betterAsyncore.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Piotr Kliczewski: Looks good to me, approved Nir Soffer: Verified Jenkins CI: Passed CI tests Francesco Romani: Looks good to me, but someone else must approve
vdsm-patches@lists.fedorahosted.org