If a gpg.exe process is assigned to a job object, an automatically started gpg-agent.exe process inherits this association to the job object. While this is probably an uncommon situation, it can cause problems in the following scenario:
- The parent process creates a job object (Win32 system call CreateJobObject()).
- It starts gpg.exe and assigns it to the job object (AssignProcessToJobObject()).
- gpg.exe starts gpg-agent.exe.
- gpg.exe terminates.
- The parent process closes the job object. This terminates gpg-agent.exe similar to a kill (-process_group, SIGKILL) on Unix.
The gpg-agent process can't close and clean up its sockets. The next time gpg needs gpg-agent, it tries to connect it through the broken sockets and waits several seconds before it gives up and starts a new gpg-agent. This can considerably slow down decryptions.