pvandervelde / Sherlock

Sherlock provides a means to schedule and automatically execute tests in an controlled virtual machine environment.
http://pvandervelde.github.io/Sherlock
Apache License 2.0
2 stars 0 forks source link

ActiveTestStorage is not thread-safe but is not used with appropriate synchronization #25

Open pvandervelde opened 10 years ago

pvandervelde commented 10 years ago

The ActiveTestStorage is used by the TestController and the TestCycle. Both are using their own locks to access the collections (thus being thread-safe within themselves) but they are not synchronizing properly between them (thus not being thread-safe in that way). The TestCycle uses the collection to verify that the environments are still alive and the TestController uses it to add / remove environments as they are activated / deactivated.

The risk here is low-ish in that we either miss an environment in a ping cycle or have one environment too many in a ping cycle (possibly see #12).