Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(255)

Issue 13386044: state: avoid panic in watchers

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by rog
Modified:
10 years, 7 months ago
Reviewers:
mp+182915, natefinch, wallyworld
Visibility:
Public.

Description

state: avoid panic in watchers If the state is closed underneath a watcher, the underlying watcher.Watcher will die with no error. That should not itself trigger a panic. I have not added test coverage for every single entry point that creates a given kind of watcher. I feel that adds unnecessarily to the test burden, and with this particular kind of test, inspecting the test coverage shows clearly which watchers are tested in this way. https://code.launchpad.net/~rogpeppe/juju-core/380-avoid-watcher-panic/+merge/182915 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: avoid panic in watchers #

Total comments: 6

Patch Set 3 : state: avoid panic in watchers #

Patch Set 4 : state: avoid panic in watchers #

Patch Set 5 : state: avoid panic in watchers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -40 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M provider/azure/environ_test.go View 1 2 3 4 1 chunk +0 lines, -15 lines 0 comments Download
M state/apiserver/common/watch_test.go View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M state/machine_test.go View 3 chunks +39 lines, -0 lines 0 comments Download
M state/relationunit_test.go View 1 2 3 4 5 chunks +16 lines, -7 lines 0 comments Download
M state/state_test.go View 1 2 3 4 5 chunks +66 lines, -0 lines 0 comments Download
M state/watcher.go View 1 2 23 chunks +78 lines, -18 lines 0 comments Download

Messages

Total messages: 7
rog
Please take a look.
10 years, 7 months ago (2013-08-29 14:01:30 UTC) #1
natefinch
Nothing too major, but some comments above. I don't feel comfortable enough with the code ...
10 years, 7 months ago (2013-08-29 15:13:27 UTC) #2
natefinch
Nothing too major, but some comments here... I don't feel comfortable giving the green light ...
10 years, 7 months ago (2013-08-29 15:14:22 UTC) #3
rog
Please take a look. https://codereview.appspot.com/13386044/diff/3001/state/machine_test.go File state/machine_test.go (right): https://codereview.appspot.com/13386044/diff/3001/state/machine_test.go#newcode626 state/machine_test.go:626: testWatcherDiesWhenStateCloses(c, func(c *gc.C, st *state.State) ...
10 years, 7 months ago (2013-08-29 15:47:28 UTC) #4
natefinch
the changes look good, but I'm still not comfortable being the one to give the ...
10 years, 7 months ago (2013-08-29 17:02:35 UTC) #5
wallyworld
LGTM
10 years, 7 months ago (2013-08-30 00:41:44 UTC) #6
rog
10 years, 7 months ago (2013-08-30 15:27:34 UTC) #7
Please take a look.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b