oehme opened a new pull request, #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071
We have a test suite that runs around 5000 builds and before this change,
about 100 of them would fail with daemon connection issues. The symptom would
always be the same - The daemon is waiting for the build request, the client
has already sent it, but the daemon never receives it, no matter how long we
configured the timeouts. I haven't figured out why exactly this
SocketOutputStream code triggered these issues, as it looked reasonable at
first glance. But replacing it with socket.getOutputStream solves the issues
completely. All the daemon tests are passing on my Linux machine, but didn't
test this on Windows or MacOs. I suspect the non-blocking code has some kind of
race condition or it drops some bytes. I saw a couple of other issues
mentioning daemon connection problems, so I'm probably not alone in this.
As for this comment from the original Gradle code:
`we use non-blocking IO as there is no reliable way when using blocking IO
to shutdown reads while
// keeping writes active. For example, Socket.shutdownInput()
does not work on Windows.`
This was done in an [ancient version of
Gradle](https://github.com/gradle/gradle/blob/de4cb84f3958fb8d7ac5779476cf524ade72b6c0/subprojects/gradle-core/src/main/groovy/org/gradle/messaging/dispatch/SocketConnection.java#L87),
back when `inputStream.close()` was used to tell the Daemon to stop. This is
not how stopping the daemon works today and also not how stopping the Maven
daemon works. So this entire feature is unused and this extra code is probably
completely unnecessary and causing issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]