Skip to content

[JENKINS-36871] JNLPProtocol4 #1167

Closed
Closed

Description

@jenkins-infra-bot

Open sourcing the JNLPProtocol4 implementation that combines NIO with TLS encryption to resolve the regression to Thread-per-client in JNLPProtocol3


Originally reported by stephenconnolly, imported from: JNLPProtocol4
  • assignee: stephenconnolly
  • status: Closed
  • priority: Major
  • component(s): remoting
  • resolution: Fixed
  • resolved: 2016-10-07T20:35:19+00:00
  • votes: 2
  • watchers: 6
  • imported: 2025-11-25
Raw content of original issue

Open sourcing the JNLPProtocol4 implementation that combines NIO with TLS encryption to resolve the regression to Thread-per-client in JNLPProtocol3

Activity

  1. jenkins-infra-bot commented on Jul 22, 2016

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Aug 1, 2016

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      Merged towards 2.16.

    Merged towards 2.16.

  3. jenkins-infra-bot commented on Aug 1, 2016

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      Oops, wasn't fixed by that change.

    Oops, wasn't fixed by that change.

  4. jenkins-infra-bot commented on Aug 2, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol2Handler.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol3Handler.java
    http://jenkins-ci.org/commit/remoting/124439ed73fce4be1fddcff40c1c6c85a00dd7ac
    Log:
    JENKINS-36871 Migrate javadoc from classes to be removed

  5. jenkins-infra-bot commented on Aug 2, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/util/ByteBufferQueueInputStream.java
    src/test/java/org/jenkinsci/remoting/util/ByteBufferQueueInputStreamTest.java
    http://jenkins-ci.org/commit/remoting/707bfe8df5ba7392c8427b271507db08cba73a6a
    Log:
    JENKINS-36871 Tests had missed some critical bugs in this ByteBufferQueueInputStream

  6. jenkins-infra-bot commented on Aug 2, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/hudson/remoting/AbstractByteBufferCommandTransport.java
    http://jenkins-ci.org/commit/remoting/7062224c9e8a66a5a8acc405c43162f905158569
    Log:
    JENKINS-36871 Unnecessary reset of length

    • Also causes commands that span multiple frames to be corrupted
  7. jenkins-infra-bot commented on Aug 2, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/protocol/impl/SSLEngineFilterLayer.java
    http://jenkins-ci.org/commit/remoting/90425ad49bac1e6502ace8ad04006c25ed72da34
    Log:
    JENKINS-36871 Found an infinite loop under certain error state disconnects

    • Don't think this affected any real protocols, but better to fix after finding
  8. jenkins-infra-bot commented on Aug 2, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/util/KeyUtils.java
    http://jenkins-ci.org/commit/remoting/d2504bc8f461e58027b57fa2cde12dfcd7297049
    Log:
    JENKINS-36871 Slightly faster code path to get hex conversion

    • Avoids intermediate String representation. Could probably get faster still with BigInteger and zero-left-pad but it becomes harder to understand
  9. jenkins-infra-bot commented on Aug 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/hudson/remoting/Channel.java
    http://jenkins-ci.org/commit/remoting/0ef5cac61c33550a0de5e94703dd755b5bd179d7
    Log:
    JENKINS-36871 Stop complaining when the channel is already closed

  10. jenkins-infra-bot commented on Aug 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/hudson/remoting/RemoteInvocationHandler.java
    http://jenkins-ci.org/commit/remoting/adc601401d66a01c44d819a56f81c33de9c304b3
    Log:
    JENKINS-36871 When tiered compilation kicks in, sometimes you can get concurrent modification exceptions

    • They'll recover, but better is not to have to worry about it at all
  11. jenkins-infra-bot commented on Aug 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/hudson/remoting/Engine.java
    http://jenkins-ci.org/commit/remoting/9ad1ed1b1d570d184ee5c89f64cf5b597a81d206
    Log:
    JENKINS-36871 Suppress extra socket connection when all protocols have been tried

    • Also better setup of the SSLContext
  12. jenkins-infra-bot commented on Aug 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/engine/EngineUtil.java
    http://jenkins-ci.org/commit/remoting/a065e8a9a914e9065fbead57af00715d7d30e0c0
    Log:
    JENKINS-36871 Make the method signature more generic

  13. jenkins-infra-bot commented on Aug 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/remoting/engine/Jnlp3ConnectionState.java src/main/java/org/jenkinsci/remoting/engine/Jnlp4ConnectionState.java src/main/java/org/jenkinsci/remoting/engine/JnlpClientDatabase.java src/main/java/org/jenkinsci/remoting/engine/JnlpConnectionState.java src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol1Handler.java src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol2Handler.java src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol3Handler.java src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol4Handler.java src/main/java/org/jenkinsci/remoting/engine/JnlpProtocolHandler.java src/main/java/org/jenkinsci/remoting/engine/JnlpProtocolHandlerFactory.java src/main/java/org/jenkinsci/remoting/engine/LegacyJnlpConnectionState.java src/main/java/org/jenkinsci/remoting/engine/LegacyJnlpProtocolHandler.java http://jenkins-ci.org/commit/remoting/6449a73f157f48efe0de53255d22a63734514d42 Log: JENKINS-36871 All the handlers need the client database

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/engine/Jnlp3ConnectionState.java
    src/main/java/org/jenkinsci/remoting/engine/Jnlp4ConnectionState.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpClientDatabase.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpConnectionState.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol1Handler.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol2Handler.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol3Handler.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocol4Handler.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocolHandler.java
    src/main/java/org/jenkinsci/remoting/engine/JnlpProtocolHandlerFactory.java
    src/main/java/org/jenkinsci/remoting/engine/LegacyJnlpConnectionState.java
    src/main/java/org/jenkinsci/remoting/engine/LegacyJnlpProtocolHandler.java
    http://jenkins-ci.org/commit/remoting/6449a73f157f48efe0de53255d22a63734514d42
    Log:
    JENKINS-36871 All the handlers need the client database

  14. jenkins-infra-bot commented on Aug 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/protocol/impl/ChannelApplicationLayer.java
    http://jenkins-ci.org/commit/remoting/8bb6354a188133ea8568bdb332393251ab6b06c1
    Log:
    JENKINS-36871 Correctly detect and report the channel being closed for writing

  15. jenkins-infra-bot commented on Aug 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    src/main/java/org/jenkinsci/remoting/protocol/impl/SSLEngineFilterLayer.java
    http://jenkins-ci.org/commit/remoting/a6e45c52a3643c2384a393e2ee8308853454f887
    Log:
    JENKINS-36871 Don't spam the logs with warnings for closed I/O or refused connections

  16. 26 remaining items

  17. jenkins-infra-bot commented on Sep 27, 2016

    @jenkins-infra-bot
    Author
    antoniobeyah:
    • Original comment link
    • Raw content of original comment:

      +1, also interested in this. Any update on when this is expected to be released?

    +1, also interested in this. Any update on when this is expected to be released?

  18. jenkins-infra-bot commented on Oct 7, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      Marking it as Resolved. We're preparing to the Remoting 3.0 release right now

    Marking it as Resolved. We're preparing to the Remoting 3.0 release right now

  19. jenkins-infra-bot commented on Oct 20, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Stephen Connolly Path: core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java core/src/main/java/jenkins/slaves/IOHubProvider.java core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly core/src/main/resources/jenkins/slaves/Messages.properties core/src/test/java/jenkins/slaves/DefaultJnlpSlaveReceiverTest.java pom.xml http://jenkins-ci.org/commit/jenkins/71cbe0cc7c601c04509faa618b23194335288fee Log: [JENKINS-36871, JENKINS-37565] JNLP4-connect implementation and Remoting 3 (#2492)

      • JENKINS-36871 Switch to the new JnlpProtocolHandler based implementation

      Todo

      • Restore the cookie behaviour (but done right this time)
      • Perhaps investigate issuing clients with TLS certificates (but would require a UI for managing them)
      • JENKINS-36871 Oleg wants to log an exception that cannot happen

    Code changed in jenkins
    User: Stephen Connolly
    Path:
    core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
    core/src/main/java/jenkins/slaves/IOHubProvider.java
    core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java
    core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java
    core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java
    core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java
    core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java
    core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java
    core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly
    core/src/main/resources/jenkins/slaves/Messages.properties
    core/src/test/java/jenkins/slaves/DefaultJnlpSlaveReceiverTest.java
    pom.xml
    http://jenkins-ci.org/commit/jenkins/71cbe0cc7c601c04509faa618b23194335288fee
    Log:
    [JENKINS-36871, JENKINS-37565] JNLP4-connect implementation and Remoting 3 (#2492)

    • JENKINS-36871 Switch to the new JnlpProtocolHandler based implementation

    Todo

    • Restore the cookie behaviour (but done right this time)
    • Perhaps investigate issuing clients with TLS certificates (but would require a UI for managing them)
    • JENKINS-36871 Oleg wants to log an exception that cannot happen
  20. jenkins-infra-bot commented on Oct 23, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      The fix is integrated towards 2.27

    The fix is integrated towards 2.27

  21. jenkins-infra-bot commented on Dec 27, 2016

    @jenkins-infra-bot
    Author
    sag47:
    • Original comment link
    • Raw content of original comment:

      How does one confirm that JNLP4 is being used? I tried the latest Jenkins ver. 2.38 (weekly) and configured a JNLP slave (there's no option to configure what kind of JNLP slave).

      Additionally, the agent logs don't show much in the way of output confirming which JNLP protocol is even being used. Here's the full log output from the initialization of the JNLP slave.

      JNLP agent connected from /REDACTED
      <===[JENKINS REMOTING CAPACITY]===>Slave.jar version: 3.3
      This is a Unix agent
      Agent successfully connected and online
      

      So far, I'm not sure how to tell what protocol is being used.

    How does one confirm that JNLP4 is being used? I tried the latest Jenkins ver. 2.38 (weekly) and configured a JNLP slave (there's no option to configure what kind of JNLP slave).

    Additionally, the agent logs don't show much in the way of output confirming which JNLP protocol is even being used. Here's the full log output from the initialization of the JNLP slave.

    JNLP agent connected from /REDACTED
    <===[JENKINS REMOTING CAPACITY]===>Slave.jar version: 3.3
    This is a Unix agent
    Agent successfully connected and online
    

    So far, I'm not sure how to tell what protocol is being used.

  22. jenkins-infra-bot commented on Dec 27, 2016

    @jenkins-infra-bot
    Author
    sag47:
    • Original comment link
    • Raw content of original comment:

      Nevermind, I found it in Manage Jenkins > Configure Global Security > JNLP. In the Advanced section, you have to enable JNLP4 (and can optionally disable the other protocols). Then if you look at the agent log you can see the JNLP4 class being used in the thread dump output. It would be nice if the agent Log output displayed which protocol it is using in the agent startup information.

    Nevermind, I found it in Manage Jenkins > Configure Global Security > JNLP. In the Advanced section, you have to enable JNLP4 (and can optionally disable the other protocols). Then if you look at the agent log you can see the JNLP4 class being used in the thread dump output. It would be nice if the agent Log output displayed which protocol it is using in the agent startup information.

  23. jenkins-infra-bot commented on Dec 27, 2016

    @jenkins-infra-bot
    Author
    sag47:
    • Original comment link
    • Raw content of original comment:

      It would be nice if the agent Log output displayed which protocol it is using in the agent startup information.

      I created JENKINS-40700 as an enhancement.

    It would be nice if the agent Log output displayed which protocol it is using in the agent startup information.

    I created JENKINS-40700 as an enhancement.

  24. jenkins-infra-bot commented on Nov 25, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-33886]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions