Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Ensure resource HTTP handlers release state #6703
Conversation
|
Please also land equivalent on 2.1. |
|
Definitely want this in 2.1 ASAP. |
|
Hmm, following the QA steps didn't give me great joy. Investigating. |
|
!!build!! |
| +// CombineErrors converts a set of errors (which might be nil) into | ||
| +// one. If there are no errors, this returns an untyped nil, and if | ||
| +// there's one error it's passed through directly. | ||
| +func CombineErrors(errs ...error) error { |
babbageclunk
Dec 14, 2016
Member
Do we already have something like this somewhere? It seems like we would. Where should it live if not? github.com/juju/errors?
babbageclunk
Dec 14, 2016
Member
This is definitely not the right place for it, just wasn't sure what the right one was.
mjs
Dec 14, 2016
Contributor
I haven't seen anything quite like this anywhere. The closest I've seen is something that attempts to choose the "worst" error given a set of multiple errors.
juju/errors seems like a reasonable place for this to live but given that I'm not aware of something similar elsehwhere, perhaps we haven't needed it much. I'm ok with it staying here for now.
|
With the latest commit repeated migration back and forth with a resource-using charm deployed works, but it's substantially gnarlier than the original changes, so it could do with rereview. I see what you mean about the resources code, @mjs. |
| +// CombineErrors converts a set of errors (which might be nil) into | ||
| +// one. If there are no errors, this returns an untyped nil, and if | ||
| +// there's one error it's passed through directly. | ||
| +func CombineErrors(errs ...error) error { |
babbageclunk
Dec 14, 2016
Member
Do we already have something like this somewhere? It seems like we would. Where should it live if not? github.com/juju/errors?
babbageclunk
Dec 14, 2016
Member
This is definitely not the right place for it, just wasn't sure what the right one was.
mjs
Dec 14, 2016
Contributor
I haven't seen anything quite like this anywhere. The closest I've seen is something that attempts to choose the "worst" error given a set of multiple errors.
juju/errors seems like a reasonable place for this to live but given that I'm not aware of something similar elsehwhere, perhaps we haven't needed it much. I'm ok with it staying here for now.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
Trusty tests panicked with $$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
babbageclunk commentedDec 14, 2016
The resource HTTP handler didn't release the state back into the state
pool - this would mean that it would stick around in the pool even after
the model was migrated away, preventing the same model from being
migrated back. (It would also leak the state if the model was destroyed.)
Thread the call to httpContext.release through so it can be called from
the right place in the resource HTTP handler.
This is the last piece of fixing https://bugs.launchpad.net/juju/+bug/1641824
QA steps:
juju deploy -m A:m cs:~cmars/mattermost --resource bdist=<path to binary distribution>juju migrate -c A m Bjuju migrate -c B m A