Bound JDI test attach attempts by the startup deadline - #60
carstenartur wants to merge 2 commits into
Conversation
Exercise the real JDI connector against a local TCP peer that accepts the connection and reads the handshake but never replies. Closing the peer in finally releases the unfixed startup path after the regression is reported. Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
The outer retry deadline cannot interrupt an attach using the default infinite timeout. Pass a positive remaining budget to the connector and report transport timeouts through the existing startup failure path. Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
|
The proven attach-deadline fix has now been integrated into the existing upstream infrastructure PR eclipse-jdt#992, in commit The integration also retains the transport cause and pre-cleanup process state in the exception report, and verifies that a handshake timeout actually reaches startup cleanup. Executed validation: https://github.com/carstenartur/eclipse.jdt.debug/actions/runs/33986167245, artifact
The separate draft here retains the original minimal reproduction for reference. This does not establish that a silent handshake caused the original |
|
Superseded by the integrated startup/cleanup fix in upstream eclipse-jdt#992 at There is no longer a need to submit this older standalone draft separately upstream. Its original before/after evidence is retained here. PR eclipse-jdt#990 now includes the tested eclipse-jdt#992 commits as a separately identifiable dependency via merge Closing this fork-only draft as superseded, not merged. |
Upstream submission
This is the prepared infrastructure fix for eclipse-jdt/eclipse.jdt.debug. The connected integration returned HTTP 403 when opening the upstream PR, so the patch and its reviewed scope are retained here.
Open the upstream pull-request comparison
This fork PR targets a read-only review baseline at upstream commit
af15c262973bc93c130d33b993c5fd3195ae3ab5, not the fork's diverged working master. It contains exactly the three files intended for upstream. Please use upstreammasteras the base when submitting there.What it does
Fixes a reproduced hang in the JDI test infrastructure:
AbstractJDITest.connectToVM()checks a five-second retry budget, but calls the attaching connector with its defaulttimeout=0. An accepted TCP connection whose peer does not reply to the JDWP handshake can therefore block insideattach()indefinitely. The outer retry loop never regains control to enforce its deadline.The change passes a positive remaining startup budget to each attach attempt and handles
org.eclipse.jdi.TimeoutExceptionthrough the existing startup-failure path. It retains the five-second budget rather than increasing it.Only the JDI test bundle changes:
AbstractJDITest: configure the attach timeout and handle its expiration.VMConnectionTimeoutTest: exercise a real socket and the actual Eclipse JDI attaching connector against a silent peer.AutomatedSuite: include the new regression test.No product debugger implementation, breakpoint code, test exclusion or retry-on-success mechanism is changed. No fork CI files are included in this PR.
How to test
Run
org.eclipse.debug.jdi.tests.VMConnectionTimeoutTestas a JUnit Plug-in Test, or run the JDIAutomatedSuite.The regression test opens a local TCP server, accepts the connection, reads and verifies
JDWP-Handshake, and deliberately sends no reply. The unchanged test fails if the startup thread remains blocked beyond its ten-second safety guard. With the fix, startup instead reports its ordinaryCould not contact the VMerror after the five-second budget, and the test passes.The real
connectToVM()implementation and real JDI connector are used. A process double supplies only the console streams; it does not implement or simulate the transport. The peer is closed infinallyto release even the unfixed implementation, and the startup thread, readers and previous static port are cleaned up/restored.Executed before/after validation
Completed Tycho regression run, artifact
jdi-startup-regression.Both phases used the same test source, Java 26 toolchain and parent POM. The reactor built the JDI implementation and test bundle in both phases.
3e00ec4)The connector blocked past the startup deadline on a silent peer3ed46cb)The validation checked the XML for exactly the intended named failure before the fix and a passing execution afterward, with no skipped tests. It did not infer success from Maven's exit status. Raw XML, Maven logs, the applied patch and toolchain checksums are retained in the artifact.
This is targeted before/after validation. A full upstream regression-suite result is still outstanding; the PR is draft pending that check.
Relationship to the failing builds under investigation
This defect was found while investigating the aborted builds for eclipse-jdt#990 and eclipse-jdt#992. It is independently reproducible and is separate from the startup-cleanup change in eclipse-jdt#992 upstream.
This PR does not claim that a silent handshake caused those original Jenkins failures. Their published failures include
Connection refused; the complete Jenkins logs/thread dumps were not accessible in this investigation. Bounding a potentially unbounded attach fixes a demonstrated infrastructure bug, but does not itself make an unavailable VM accept a connection. The original startup failures still need to be followed through to a successful upstream run.Author checklist