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

(master) CA-134784: Fix race conditions in refcounter #170

Closed
wants to merge 1 commit into from
Closed

(master) CA-134784: Fix race conditions in refcounter #170

wants to merge 1 commit into from

Conversation

matelakat
Copy link
Contributor

Concurrent refcounter operations on two different refcounters sharing
the same namespace can lead to race conditions:
A.) By the time the refcounter file is written, the namespace directory
has already been removed
B.) Removing a namespace directory fails, because a a new refcounter file
has been created within the same directory

_writeCount now returns False if the file was not found

A is solved by spinning on _writeCount until it succeeds.
B is solved by ignoring such situations.

Signed-off-by: Mate Lakat mate.lakat@citrix.com

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 2b9bfe8fc32763b97518d406c3e7589d1df914dc on matelakat:CA-134784 into * on xapi-project:master*.

@matelakat matelakat changed the title CA-134784: Fix race conditions in refcounter (master) CA-134784: Fix race conditions in refcounter Jun 10, 2014
Concurrent refcounter operations on two different refcounters sharing
the same namespace can lead to race conditions:
 A.) By the time the refcounter file is written, the namespace directory
     has already been removed
 B.) Removing a namespace directory fails, because a a new refcounter file
     has been created within the same directory

_writeCount now returns False if the file was not found

A is solved by spinning on _writeCount until it succeeds.
B is solved by ignoring the errors

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 62caa19 on matelakat:CA-134784 into * on xapi-project:master*.

@matelakat
Copy link
Contributor Author

Closing it down as the change does not include unit tests.

@matelakat matelakat closed this Jun 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants