Skip to content

Fix minion failover after disconnect - #30796

Merged
cachedout merged 1 commit into
saltstack:developfrom
skizunov:develop2
Feb 2, 2016
Merged

cachedout merged 1 commit into
saltstack:developfrom
skizunov:develop2

Conversation

@skizunov

@skizunov skizunov commented Feb 1, 2016

Copy link
Copy Markdown
Contributor

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]

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
@cachedout
cachedout merged commit fc1437c into saltstack:develop Feb 2, 2016
@cachedout

Copy link
Copy Markdown
Contributor

Very nice as always, @skizunov. Thank you very much!

@meggiebot

Copy link
Copy Markdown

Per comment in #29567 this PR is part of the fix and should be backported to 2015.8 as well

@meggiebot meggiebot added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label Mar 8, 2016
@rallytime rallytime added Bugfix - [Done] back-ported and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants