Dan Kenigsberg has submitted this change and it was merged.

Change subject: protocoldetector: Introduce _close_connection
......................................................................


protocoldetector: Introduce _close_connection

In http://gerrit.ovirt.org/33982 we learned that having to both remove a
connection and close the socket is error prone. We have 4 places where
we do this, and one other place where we remove a connection, and close
the socket only if detection failed.

This patch simplifies the rules and removes duplicate calls to
self._remove_connection() followed by socket.close() by introducing
_close_connection(). _close_connection() is used for all fatal errors,
and _remove_connection() is used only when detection is successful.

Having this method, we can clean up connection handling around protocol
detection. Previously we used to remove the connection before trying to
detect the protocol, and if protocol detection failed, the socket was
closed. This also fixes logging, so we first report that a protocol was
detected, and then report that the connection was removed.

Change-Id: I522dbe8d6e0bccaa9e85dba3f28bed44d80988eb
Signed-off-by: Nir Soffer <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/33988
Reviewed-by: Piotr Kliczewski <[email protected]>
Reviewed-by: Dima Kuznetsov <[email protected]>
Reviewed-by: Saggi Mizrahi <[email protected]>
---
M vdsm/protocoldetector.py
1 file changed, 10 insertions(+), 10 deletions(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Verified
  Saggi Mizrahi: Looks good to me, approved
  Dima Kuznetsov: Looks good to me, but someone else must approve



-- 
To view, visit http://gerrit.ovirt.org/33988
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I522dbe8d6e0bccaa9e85dba3f28bed44d80988eb
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dima Kuznetsov <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to