Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Race condition? #12
Thanks for your work on this. It looks very promising.
I'm running -portable on Linux. I've gotten it built and am able to run a command to register and request some certs from the staging service. However, during this run I get the following:
It appears that the client is trying to authorize to request certificates before it's registered.
I've only begun digging into what's happening, but in the course of diagnosing, I encountered a Heisenbug: some of my debug printfs caused the whole routine to work. Reducing this, if I put a usleep(500) at the top of xrun(), I get a successful run every time. If I remove the usleep(), it fails every time. (I am clearing and replacing the whole of /acme with each run.)
This begins to smell of a race condition, so I thought I'd go ahead and report it even though I don't have a solution yet.
Yes, I think you're right. I'll implement a fix as soon as I can. (Basically, the key is created and then the process checks if it's there: if it is, the -N or -n flags are ignored.)
As a workaround, you can create the keys yourself and not use the -N or -n flags for now. This is only blowing up now because fork+exec causes the check to occur twice.