Docker for Windows won't run if Razer Synapse driver management tool is running
1–10 of 191 posts
Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#2I can totally see how this happened, and I would definitely not say that I would never make this mistake, especially under time pressure etc. But a careful programmer would a) desire to understand what the code did, and thus spend enough time reading it to spot the `GetType()`, and b) test that the "prevent more than one instance from running" behaviour worked properly, which would involve both testing that you can't run two instances of the program, and testing that if you change the assembly identifier, you can run two instances.
Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#3Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#4What am I looking for in the screenshot ?
Someone at Docker and someone at Razer both copy-pasted the same faulty code from Stack Overflow for preventing multiple instances of their program running at once. Unfortunately the code took the assembly identifier and called GetType() on it which returns the same value for all programs.
The Stack Overflow answer was later fixed but since the programmers no doubt both felt they'd "solved" the problem, they didn't see the fixed answer.
Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#5What am I looking for in the screenshot ?
> Both programs want to ensure you only run one copy of themselves. So they create a global mutex using the GUID of their .NET assembly, right?
> So what happens is that both of them are creating a global mutex to ensure only one copy runs, but instead of basing the GUID on their own code, they're both using the GUID of a part of .NET itself. > And they're using the same one!
> Back in 2009, the user "Nathan" asked how to get the GUID of the running assembly. Twelve minutes later, "Cerebrus" answered. And that answer was wrong.
> A year and a month later, it was pointed out (by "Yoopergeek") that it gives the wrong GUID.
> Three years later, Cerebrus returns and fixes the answer. They can't delete it, because it was accepted
> That flawed stackoverflow post is here: https://stackoverflow.com/questions/502303/how-do-i-programm...
Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#6If I need to use stackoverflow, these days I make sure I do a few things:
- read a number of answers, comments included. Just because an answer is accepted doesn’t mean it’s the best one
- read API docs for anything I’m unfamiliar with, and make sure I understand how the solution works
- never copy paste; instead use the general idea or concept to rewrite a solution in a safe, future proof manner
- if an answer works but doesn’t feel like the right solution, be prepared to do my own research to find a better approach
Hopefully this results in a better engineered product, but one of the main benefits is learning and expanding knowledge of APIs/techniques.
Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#7Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#8What am I looking for in the screenshot ?
You would sadly have to find your way through the Twitter "thread" to fully understand. Someone at Docker and someone at Razer both copy-pasted the same faulty code from Stack Overflow for preventing multiple instances of their program running at once. Unfortunately the code took the assembly identifier and called GetType() on it which returns the same value for all programs. The Stack Overflow answer was later fixed…
I'm sure someone has written a thingy to upgrade npm dependencies, rerun tests, and bisect to tell you about the breaking upgrade if anything reaks.
Left-pad, come back, all is forgiven.
Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#9When I need to ensure only one copy to run I never used GUID, I always used some combination of project name + my name + current date + customer name/business. This way is unique and with a personal touch. Also you can make it as long as you want up to MAX_PATH, not the short style that GUID does it.
Re: Docker for Windows won't run if Razer Synapse driver management tool is running
#10Wait... WHAT??
Who the hell copy pastes code into their program without first examining and understanding what each step is actually doing, how and why the pieces fit together as they do, and how it works as a whole to solve the problem?