-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
Win 10, amd64, Oracle JDK 8u131
Remoting 3.14
I discovered it during the cleanup of JENKINS-38696.
Windows implementation of NIO Channel Selector does not request "Select now" in https://github.com/jenkinsci/remoting/blob/6165d6fb6a71a7f4fce52ce5fc4cac479052ce04/src/main/java/org/jenkinsci/remoting/protocol/IOHub.java#L436 and hence calls selector#select()... and this method has no timeout.
When the code gets into this branch, Selector will be waiting infinitely without calling selector#isOpen(). Such implementation relies on the Selector implementation, which shout interrupt the select() wait if the selector is being closed. But apparently it does not no my machine (Win 10, amd64, Oracle JDK 8u131)
I propose to just add wait timeout and make the IOHub implementation to loop in the logic.
- is related to
-
JENKINS-38696 remoting unit tests fail on windows (AGAIN!)
-
- Resolved
-
Code changed in jenkins
User: Oleg Nenashev
Path:
Jenkinsfile
src/main/java/org/jenkinsci/remoting/protocol/IOHub.java
http://jenkins-ci.org/commit/remoting/a916c6474de134874818c9847253fb163d360dbc
Log:
[JENKINS-47965, JENKINS-38696] - IOHub should not wait infinitely for Selector in Windows. (#221)
Windows implementation of NIO Channel Selector does not request "Select now" in https://github.com/jenkinsci/remoting/blob/6165d6fb6a71a7f4fce52ce5fc4cac479052ce04/src/main/java/org/jenkinsci/remoting/protocol/IOHub.java#L436 and hence calls selector#select()... and this method has no timeout.
When the code gets into this branch, Selector will be waiting infinitely without calling selector#isOpen(). Such implementation relies on the Selector implementation, which shout interrupt the select() wait if the selector is being closed. But apparently it does not no my machine (Win 10, amd64, Oracle JDK 8u131)
This change adds wait timeout and makes the IOHub implementation to loop in the logic.
JENKINS-47965- Lame implementation of IOHub Selector wakeup thread for WindowsJENKINS-47965- Polish the implementationJENKINS-38696- Add Windows back to CI and make @jtnord happyJENKINS-47965- Simplify the logicJENKINS-47965- Replace Thread.sleep() by object wait()/notify()JENKINS-47965- Cleanup the locking logicJENKINS-47965- Address comments from @jtnord, run Selector Watcher in Unix systems as well