Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45294

Remoting should reject RPCRequests over the closing channel

      It is a follow-up to JENKINS-45023, where I have added checks for UserRequests in Remoting. It should help with the most of cases, but some requests like remote CommandLaunchers in Jenkins core may still hang because they use RPCRequests which are not filtered.

      OTOH some system objects are actually expected to be executed for closing channels (e.g. ClassLoaders), hence it needs additional investigation.

          [JENKINS-45294] Remoting should reject RPCRequests over the closing channel

          Oleg Nenashev created issue -

          Jesse Glick added a comment -

          some system objects are actually expected to be executed for closing channels (e.g. ClassLoaders)

          There are generally problems in Java with ClassLoader instances being asked to load some classes during clean-up of something, when it is actually too late to do any more loading. I suppose in this case you could exempt RemoteClassLoader calls from having the new behavior applied. For everything else I think it is appropriate.

          Jesse Glick added a comment - some system objects are actually expected to be executed for closing channels (e.g. ClassLoaders) There are generally problems in Java with ClassLoader instances being asked to load some classes during clean-up of something, when it is actually too late to do any more loading. I suppose in this case you could exempt RemoteClassLoader calls from having the new behavior applied. For everything else I think it is appropriate.

          Oleg Nenashev added a comment -

          Yes, maybe I will create a Remoting-internal SystemRPCRequest class for that. I also do not see other cases where RPC requests are really required, so maybe it makes sense to give a try while we are far from the next LTS baseline selection

          Oleg Nenashev added a comment - Yes, maybe I will create a Remoting-internal SystemRPCRequest class for that. I also do not see other cases where RPC requests are really required, so maybe it makes sense to give a try while we are far from the next LTS baseline selection
          Oleg Nenashev made changes -
          Epic Link New: JENKINS-38833 [ 175240 ]
          Oleg Nenashev made changes -
          Assignee New: Oleg Nenashev [ oleg_nenashev ]
          Oleg Nenashev made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Oleg Nenashev made changes -
          Link New: This issue is related to JENKINS-45023 [ JENKINS-45023 ]
          Oleg Nenashev made changes -
          Remote Link New: This issue links to "https://github.com/jenkinsci/remoting/pull/209 (Web Link)" [ 17963 ]
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-47791 [ JENKINS-47791 ]

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/hudson/remoting/Channel.java
          src/main/java/hudson/remoting/ImportedClassLoaderTable.java
          src/main/java/hudson/remoting/RemoteClassLoader.java
          src/main/java/hudson/remoting/RemoteInvocationHandler.java
          src/test/java/hudson/remoting/ChannelTest.java
          src/test/java/hudson/remoting/PipeWriterTest.java
          http://jenkins-ci.org/commit/remoting/b46db643959c9b4c9837d5406cfaf08cad418e6c
          Log:
          JENKINS-45294 - RemoteInvocationHandler#RPCRequest is now a subject for channel status checks (#209)

          • JENKINS-45294 - RemoteInvocationHandler#RPCRequest is now a subject for channel status checks

          It is same as https://github.com/jenkinsci/remoting/pull/175, but for RPC Requests.
          The idea is to prevent hanging of RPC Requests in edge cases when the channel goes down.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/remoting/Channel.java src/main/java/hudson/remoting/ImportedClassLoaderTable.java src/main/java/hudson/remoting/RemoteClassLoader.java src/main/java/hudson/remoting/RemoteInvocationHandler.java src/test/java/hudson/remoting/ChannelTest.java src/test/java/hudson/remoting/PipeWriterTest.java http://jenkins-ci.org/commit/remoting/b46db643959c9b4c9837d5406cfaf08cad418e6c Log: JENKINS-45294 - RemoteInvocationHandler#RPCRequest is now a subject for channel status checks (#209) JENKINS-45294 - RemoteInvocationHandler#RPCRequest is now a subject for channel status checks It is same as https://github.com/jenkinsci/remoting/pull/175 , but for RPC Requests. The idea is to prevent hanging of RPC Requests in edge cases when the channel goes down. JENKINS-45294 - Fix the stupid bug JENKINS-45294 - Add direct unit test of hanging RPC Call JENKINS-45294 - Address comments from @jglick

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: