We have our own module that can trigger a reboot of the windows client. This basically boils down to this;
After the reboot has completed we sometimes see the puppet (agent) lock file remains and the agent process is not started/aborts.
In the example I'm looking at I can see a different unrelated process occupying the pid of the original (pre reboot) puppet agent process.
So I suspect that is preventing the automatic cleanup of the lock file. And hence is the explanation of the intermittent nature of the bug.
I am new to this project and I am not a ruby coder, but I can have a go. But I would appreciate validation of the bug and also some pointers to where in the code base I can find where the lock file clean up is done.