New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overlord/ifacestate: remove "old-conn" from connect/undo connect handlers #5718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not disagreeing, but can we have some more background for the choice of dropping undo? What are the consequences of doing that, and what is the rationale for not attempting to undo a disconnection?
@niemeyer this code precisely doesn't touch disconnect or its undo as @stolowski mentions in the description, it's about the case of undoing a form of connect (connect for an already existing connection) that we agreed in the end not to use/support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks correct to me
@niemeyer Yes, as Samule said, it's about undo for connect only. We simply never run connect handler over existing connection; connect can only be run if there is no connection yet, so there is no point in storing old-connection in the task; undo'ing connect is just removing connection from the state (from conns). And of course as part of connect undo we also run disconnect- and unprepare- hooks. |
Makes sense, thanks. |
Codecov Report
@@ Coverage Diff @@
## master #5718 +/- ##
==========================================
+ Coverage 78.98% 79.32% +0.34%
==========================================
Files 525 528 +3
Lines 40105 40776 +671
==========================================
+ Hits 31676 32345 +669
+ Misses 5856 5852 -4
- Partials 2573 2579 +6
Continue to review full report at Codecov.
|
Remove "old-conn" attribute from connect and its undo handler.
It was initially implemented to support re-connecting over existing connection, in which case undo would restore the previous state of the connection. The idea of re-connecting existing connection was however dropped and re-connecting is explicitly prevented in
ifacestate.Connect(..)
method.Note, "old-conn" is also used in disconnect/disconnect-undo handlers, but it's required there.