Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Add mutex and test for safe concurrent VBoxManage access #2179

Closed

Conversation

nathanleclaire
Copy link
Contributor

Closes #2154

Signed-off-by: Nathan LeClaire nathan.leclaire@gmail.com

@nathanleclaire
Copy link
Contributor Author

Like I said I think it may allow us to also remove the serial bit in runActionForeachMachine as well. We'll see.

@nathanleclaire
Copy link
Contributor Author

@docker/machine-maintainers PTAL

@dmp42
Copy link
Contributor

dmp42 commented Nov 5, 2015

This is tripping a race condition apparently.

@nathanleclaire
Copy link
Contributor Author

Yeah, I noticed that. I'm actually not sure how much good the test is doing in this case (since essentially it's elaborate test of mutex itself), so I might just take it out, even though I initially was really adamant about including one.

@nathanleclaire
Copy link
Contributor Author

Alright, how about this: I've turned off running this test on go test -race using build tag exclusion. I want to still have the test run in CI, however, so I also added a line to test-long target in Makefile to also run go test without -race. The overhead is not really substantial as far as I can tell (a few extra seconds). This seems to be a reasonable compromise to me.

@nathanleclaire
Copy link
Contributor Author

To be clear, it's intentional that the test races.

@nathanleclaire nathanleclaire added this to the 0.5.1 milestone Nov 5, 2015
@nathanleclaire nathanleclaire self-assigned this Nov 5, 2015
@dmp42
Copy link
Contributor

dmp42 commented Nov 5, 2015

however, so I also added a line to test-long target in Makefile to also run go test without -race

Ah - I don't think you need this actually - test-short will already run your test (unless your test is specifically meant to run only on long?).

@docker/machine-maintainers PTAL

@nathanleclaire
Copy link
Contributor Author

Right, I see. I'll take the Makefile change out then. Should be good to go since you have to intentionally mark tests which will get skipped with short, which I haven't done here.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
@dgageot
Copy link
Member

dgageot commented Nov 5, 2015

@nathanleclaire I've tested the code with #2154 and it does not solve the issue.

Reopening #2172 which fixes the #2154 issue.

@dgageot
Copy link
Member

dgageot commented Nov 6, 2015

@nathanleclaire shall we close this PR? Clearly, the mutex has no effect since each virtualbox driver is running in its own process.

@nathanleclaire
Copy link
Contributor Author

@dgageot Yep

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants