From Dan Kenigsberg <dan...@redhat.com>:

Dan Kenigsberg has submitted this change and it was merged.

Change subject: protocoldetector: Fix random double close
......................................................................


protocoldetector: Fix random double close

Previously we stopped the reactor before closing the acceptor. This
works most of the time, but once in a while, it fails with this error:

    Traceback (most recent call last):
      File "vdsm/tests/protocoldetectorTests.py", line 113, in tearDown
        self.acceptor.stop()
      File "vdsm/lib/vdsm/protocoldetector.py", line 211, in stop
        self._acceptor.close()
      File "/usr/lib64/python2.7/asyncore.py", line 407, in close
        self.del_channel()
      File "vdsm/lib/yajsonrpc/betterAsyncore.py", line 137, in del_channel
        asyncore.dispatcher.del_channel(self, map)
      File "/usr/lib64/python2.7/asyncore.py", line 292, in del_channel
        del map[fd]
    KeyError: 63

The flow of events leading to this error is:

1. Stooping reactor, signaling the reactor thread via eventfd
2. Context switch to the reactor thread
3. Reactor find it it was closed and close all dispatchers
4. Context switch to the original thread
5. Closing acceptor, fd is not in asyncore map

This patch fixes this issue by closing the acceptor before stopping the
reactor.

Change-Id: I0cec41c4baebcc620b70e19e62febed5dc9c542d
Signed-off-by: Nir Soffer <nsof...@redhat.com>
---
M lib/vdsm/protocoldetector.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Piotr Kliczewski: Looks good to me, approved
  Nir Soffer: Verified
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/65187
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0cec41c4baebcc620b70e19e62febed5dc9c542d
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to