Skip to content
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

Cleanup the state package around watchers. #10491

Merged
merged 4 commits into from Aug 11, 2019

Conversation

howbazaar
Copy link
Contributor

When the initial split of the watcher type into the txnwatcher and the hubwatcher the old watcher was kept around for the state.Open method. Since then we refactored again to use OpenController, which made sure that there is only ever one low level watcher polling the database for changes.

However state.Open was not cleaned up. This branch removes the state.Open function, and also the watcher type from the state/watcher package.

The DeadWatcher is now a hubwatcher type rather than a watcher. Also there were a bunch of tests that were testing isolation across connections, which really aren't needed, so they have also been cleaned up.

@howbazaar
Copy link
Contributor Author

charmsSuite.TestCharmsServedSecurely malformed url

!!build!!

Copy link
Contributor

@achilleasa achilleasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice code cleanup! The changes LGTM although admittedly I don't have
much experience with this part of the code-base.

@howbazaar
Copy link
Contributor Author

$$merge$$

1 similar comment
@howbazaar
Copy link
Contributor Author

$$merge$$

@jujubot jujubot merged commit a89077d into juju:2.6 Aug 11, 2019
if hub == nil {
ws.StartWorker(txnLogWorker, func() (worker.Worker, error) {
return watcher.New(st.getTxnLogCollection()), nil
ws.StartWorker(txnLogWorker, func() (worker.Worker, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we care that none of these StartWorker calls are error checked?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little, because it has been the cause of a few hard to determine bugs. Should get to it sometime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants