RFR: 8324673: javacserver failed during build: RejectedExecutionException
Daniel Jeliński
djelinski at openjdk.org
Mon Apr 8 14:30:10 UTC 2024
On Mon, 8 Apr 2024 09:20:44 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
> The RejectedExecutionException was thrown when the thread executing `Server.start` managed to shut down the `compilerThreadPool` before the thread executing `Server.handleRequest` submitted the compilation task.
>
> This patch removes the extra thread used for `Server.handleRequest`, and executes that method directly in the thread pool. All `compilerThreadPool` uses happen on the `Server.start` thread now, and no new tasks are submitted after the thread pool is shut down.
>
> In order to verify the fix, I modified `IdleMonitor.KEEPALIVE` to 1 second. With that change the problem was occasionally reproducible without the patch from this PR. With the patch, the `RejectedExecutionException` problem did not reproduce.
>
> No new regression test. Existing langtools tests continue to pass.
It won't be a problem. The client side does not set timeout on socket read/write operations, so there's no risk of the operation timing out. Also, the OS usually buffers reads and writes, so the client write call probably won't block even if the server doesn't read. Other than that, we're using TCP sockets for communication, so no data will ever be lost.
Tried running make with JOBS=512, no problems observed. I might try that on mach5 too, just in case.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18672#issuecomment-2042901814
More information about the build-dev
mailing list