Branch: refs/heads/master
Home: https://github.com/jenkinsci/remoting
Commit: 67edc4bc4896ce99f3246b6b7cac25fbb94f71b3
https://github.com/jenkinsci/remoting/commit/67edc4bc4896ce99f3246b6b7cac25fbb94f71b3
Author: Oleg Nenashev <[email protected]>
Date: 2017-07-04 (Tue, 04 Jul 2017)
Changed paths:
M src/main/java/hudson/remoting/Channel.java
M src/main/java/hudson/remoting/ChannelClosedException.java
M src/main/java/hudson/remoting/Request.java
M src/main/java/hudson/remoting/UserRequest.java
M src/main/java/hudson/remoting/VirtualChannel.java
M src/test/java/hudson/remoting/ChannelTest.java
Log Message:
-----------
[JENKINS-45023] - Prevent execution of commands on closed or beingClosed
channels (#175)
* [JENKINS-45023] - Prevent execution of commands on closed or beingClosed
channels
This is a major update of Request execution logic in remoting Channels, which
should improve stability of the channel and prevent hanging of commands if the
channel gets closed.
- [x] - `Channel#close()` does not always wait of synchronization to happen.
There is a sender status check before the lock gets acquired. TODO: find an
issue for that
- [x] - `Channel#isClosingOrClosed()` now returns `null` once the first
`Channel#close()` command arrives, we do not even wait till it acquires the
instance lock. The API is [used outside
Remoting](https://github.com/search?q=org%3Ajenkinsci+isClosingOrClosed&type=Code),
but it seems that the change is correct in that cases
- [x] - `Channel#call()` and `Channel#callAsync()` now fail if the channel
`isClosingOrClosed()`. These calls implement `UserRequest`, and I do not think
there is a valid case for even trying any user-space request
- [x] - Offer new API in `hudson.remoting.Request`, which allows checking the
channel state before invoking a call. By default it just checks if the channel
is closed (just “fail fast” without command initialization)
- [x] - Implement the new API in `UserRequest`, to prevent low-level API calls
on a channel, which `isClosingOrClosed()`
* [JENKINS-45023] - Address Javadoc comments from @jglick
* [JENKINS-45023] - Chanel#terminate() should also immediately set the
closeRequested flag
* [JENKINS-45023] - Use ChannelClosedException when channel is being closed and
cannot accept commands
* [JENKINS-45023] - Add functional tests for the deadlocked channel
* [JENKINS-45023] - UserRequest constructor should not hang when the channel
shutdown is pendind && the lock cannot be acquired
--
You received this message because you are subscribed to the Google Groups
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.