On Wed, 10 Apr 2024 11:32:43 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:
> The "Connection attempt failed: Connection refused" error may happen if the > client tries to connect to a server that is no longer listening, which in > turn may happen if the server shuts down without removing the port file. I > added a check that the delete operation succeeded, and retry as necessary. > > I removed the comment about asynchronous deletes on Windows. I don't think > it's correct; it's more likely that the file existed because the delete > operation failed. > > I added a 1 second delay after deleting the port file; this delay is intended > to allow any clients that managed to read the port file before it was deleted > to finish connecting. It should also take care of the "IOException caught > during compilation: Connection reset" issue. > > And finally, the portfile is now closed when not in use. This was necessary > to fix the failures on Windows, where the file cannot be deleted as long as > it is open in any process. > > In order to verify the fix, I modified `IdleMonitor.KEEPALIVE` to 1 second. > Without the changes from this PR this resulted in at least a few failures in > every mach5 run. With this PR I was able to build tier1-5 with no failures. Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/18712#issuecomment-2049609810