gomaasapi: use a giant honking lock around all API calls #3

Merged
merged 1 commit into from Jan 19, 2016

Conversation

Projects
None yet
3 participants
Contributor

davecheney commented Jan 19, 2016

The test server mock has a lot of mutable state, none of it guarded
by locks. It is possible to go through each field and check who uses
it, find all their methods, add locks, rinse, repeat.

Or, we could do something really dirty and serialise all API access
through one mutex. This has the obvious side effect that API calls
are no longer concurrent, but was their any promise of that before?
The change also has the effect that a memory barrier, covering all
the state in the test server structure, is asserted before and after
each API call

Also, a tonne of gofmt

gomaasapi: use a giant honking lock around all API calls
The test server mock has a lot of mutable state, none of it guarded
by locks. It is possible to go through each field and check who uses
it, find all their methods, add locks, rinse, repeat.

Or, we could do something really dirty and serialise all API access
through one mutex. This has the obvious side effect that API calls
are no longer concurrent, but was their any promise of that before?
The change also has the effect that a memory barrier, covering all
the state in the test server structure, is asserted before and after
each API call
Owner

howbazaar commented Jan 19, 2016

👍

Owner

howbazaar commented Jan 19, 2016

let's try this $$merge$$

Contributor

jujubot commented Jan 19, 2016

jujubot added a commit that referenced this pull request Jan 19, 2016

Merge pull request #3 from davecheney/cheap-trick
gomaasapi: use a giant honking lock around all API calls

The test server mock has a lot of mutable state, none of it guarded
by locks. It is possible to go through each field and check who uses
it, find all their methods, add locks, rinse, repeat.

Or, we could do something really dirty and serialise all API access
through one mutex. This has the obvious side effect that API calls
are no longer concurrent, but was their any promise of that before?
The change also has the effect that a memory barrier, covering all
the state in the test server structure, is asserted before and after
each API call

Also, a tonne of `gofmt`

@jujubot jujubot merged commit e173bc8 into juju:master Jan 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment