You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "oehme (via GitHub)" <gi...@apache.org> on 2024/07/16 16:24:45 UTC
[PR] Fix daemon connection issues [maven-mvnd]
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix daemon connection issues [maven-mvnd]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix daemon connection issues [maven-mvnd]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071#issuecomment-2236864180
> After a lot of debugging, I've finally figured out the true cause of this, see the updated description.
>
> I guess my previous attempt had simply changed the timing slightly, reducing the flakiness on my machine, but increasing it in the Windows builds, which explains those failures.
Really nice catch.
However, even if guava is a transitive dependencies, it's not really a direct dependency in maven.
I would really prefer if we could use a JDK collection somehow, maybe `new ArrayBlockingQueue(1)` ?
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix daemon connection issues [maven-mvnd]
Posted by "oehme (via GitHub)" <gi...@apache.org>.
oehme commented on PR #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071#issuecomment-2233403571
Yep, looks like I'll have to dig into the Windows behavior some more. Taking back into draft.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix daemon connection issues [maven-mvnd]
Posted by "oehme (via GitHub)" <gi...@apache.org>.
oehme commented on PR #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071#issuecomment-2236837683
After a lot of debugging, I've finally figured out the true cause of this, see the updated description.
I guess my previous attempt had simply changed the timing slightly, reducing the flakiness on my machine, but increasing it in the Windows builds, which explains those failures.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix daemon connection issues [maven-mvnd]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071#issuecomment-2233360918
It seems much less stable on Windows for some reason...
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix daemon connection issues [maven-mvnd]
Posted by "oehme (via GitHub)" <gi...@apache.org>.
oehme commented on PR #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071#issuecomment-2236979864
Good point, changed to CompletableFuture
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix daemon connection issues [maven-mvnd]
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga commented on PR #1071:
URL: https://github.com/apache/maven-mvnd/pull/1071#issuecomment-2254619377
Indeed, great catch @oehme 🙏
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org