RFR: 8201183: sjavac build failures: "Connection attempt failed: Connection refused"

Magnus Ihse Bursie ihse at openjdk.org
Thu Apr 11 10:20:41 UTC 2024


On Wed, 10 Apr 2024 11:32:43 GMT, Daniel Jeliński <djelinski at 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.

Thank you very much for spending the time and effort of fixing these intermittent javac server issues!

-------------

Marked as reviewed by ihse (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18712#pullrequestreview-1993815955


More information about the build-dev mailing list