Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

dismiss_changed can break under certain conditions #9

Open
cmars opened this issue Mar 19, 2019 · 0 comments
Open

dismiss_changed can break under certain conditions #9

cmars opened this issue Mar 19, 2019 · 0 comments

Comments

@cmars
Copy link

cmars commented Mar 19, 2019

I'm developing an opinionated zookeeper charm based on the bigtop charm, but not dependent on bigtop's puppet-based deployment. Newer version of Zookeeper installed from a snap, comes with openjdk installed from ubuntu main archive, puppet replaced with charmhelpers jinja templating.

In testing my charm, I discovered an edge case where the dismiss_changed method on the peer object from this interface can break.

Steps that led to this issue, which might be reproducible:

  1. Deploy zookeeper
  2. Add 4 units
  3. Remove 2 units
  4. Leave it running for a while, go get some lunch

I think it might have something to do with the fact that the units were removed, so maybe some of the relation data was missing in a relation broken hook firing.

As a workaround, I'm just going to clear the flag in my zookeeper charm. That's all that the dismiss_changed method seems to do.

2019-03-19 21:58:22 DEBUG update-status Traceback (most recent call last):
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/charm/hooks/update-status", line 22, in <module>
2019-03-19 21:58:22 DEBUG update-status     main()
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 73, in main
2019-03-19 21:58:22 DEBUG update-status     bus.dispatch(restricted=restricted_mode)
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
2019-03-19 21:58:22 DEBUG update-status     _invoke(other_handlers)
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
2019-03-19 21:58:22 DEBUG update-status     handler.invoke()
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
2019-03-19 21:58:22 DEBUG update-status     self._action(*args)
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/charm/reactive/zookeeper.py", line 230, in check_cluster_changed
2019-03-19 21:58:22 DEBUG update-status     zkpeer.dismiss_changed()
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/charm/hooks/relations/zookeeper-quorum/peers.py", line 48, in dismiss_changed
2019-03-19 21:58:22 DEBUG update-status     conv.remove_state('{relation_name}.changed')
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/.venv/lib/python3.6/site-packages/charms/reactive/relations.py", line 706, in remove_state
2019-03-19 21:58:22 DEBUG update-status     state = state.format(relation_name=self.relation_name)
2019-03-19 21:58:22 DEBUG update-status   File "/var/lib/juju/agents/unit-zookeeper-4/.venv/lib/python3.6/site-packages/charms/reactive/relations.py", line 577, in relation_name
2019-03-19 21:58:22 DEBUG update-status     return self.namespace.split(':')[0]
2019-03-19 21:58:22 DEBUG update-status AttributeError: 'NoneType' object has no attribute 'split'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant