Repository navigation
Fix minion failover after disconnect - #30796
Merged
Merged
Conversation
salt/minion.py: - In the `__master_disconnected` case, it originally set `self.opts['master']` to the result of `self.eval_master`. This makes no sense since `self.eval_master` returns a future. Now we yield on `self.eval_master` and store both return values. - Just like in `Minion.destroy`, we clear `self.pub_channel.on_recv`. Also, if `self.pub_channel` has a `close`, it is invoked. This resolves a circular reference issue with the TCP transport. The `SaltMessageClient` contains function references to the `connect_callback` and `disconnect_callback` functions in `AsyncTCPPubChannel`. This circular reference prevents the `del` from deallocating the `AsyncTCPPubChannel` object. salt/transport/tcp.py: - In `SaltMessageClient.close`, reset the function references `self.connect_callback` and `self.disconnect_callback`. This allows a subsequent `del` on `AsyncTCPPubChannel` to actually deallocate the object. Signed-off-by: Sergey Kizunov <[email protected]>
cachedout
pushed a commit
that referenced
this pull request
Feb 2, 2016
Fix minion failover after disconnect
Contributor
|
Very nice as always, @skizunov. Thank you very much! |
This was referenced Feb 25, 2016
|
Per comment in #29567 this PR is part of the fix and should be backported to 2015.8 as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
salt/minion.py:
__master_disconnectedcase, it originally setself.opts['master']to the result ofself.eval_master. Thismakes no sense since
self.eval_masterreturns a future. Now weyield on
self.eval_masterand store both return values.Minion.destroy, we clearself.pub_channel.on_recv.Also, if
self.pub_channelhas aclose, it is invoked. Thisresolves a circular reference issue with the TCP transport. The
SaltMessageClientcontains function references to theconnect_callbackanddisconnect_callbackfunctions inAsyncTCPPubChannel. This circular reference prevents thedelfromdeallocating the
AsyncTCPPubChannelobject.salt/transport/tcp.py:
SaltMessageClient.close, reset the function referencesself.connect_callbackandself.disconnect_callback. This allows asubsequent
delonAsyncTCPPubChannelto actually deallocate theobject.
Signed-off-by: Sergey Kizunov [email protected]