Skip to content

[JENKINS-3889] EOFException on reconnect after network connection loss #18863

Closed

Description

@jenkins-infra-bot

In our network, we repeatedly have problems, that network connection suddenly
drops but is available again right away. After that happened, I only see the
"Connected to.." popup in Windows taskbar - that's how I recognized the
connection loss. I don't know why this happens, and it's usually no problem
during work (but network guys couldn't yet give me an answer).

In such a case, a Hudson slave (running on a computer where this happens)
terminates (Hudson slave window shows state "Terminated"). After the network
connection being available again, the slave tries to reconnect to the master,
but it fails. Hudson slave window shows state "Handshaking" and then an
EOFException occurs. See following stack:

java.io.EOFException: unexpected stream termination
at hudson.remoting.Channel.(Channel.java:312)
at hudson.remoting.Channel.(Channel.java:251)
at hudson.remoting.Channel.(Channel.java:239)
at hudson.remoting.Engine.run(Engine.java:159)

In order to reproduce the problem, simply deactivate your LAN connection in
Windows control panel (you will see Hudson slave window showing state
"Terminated") and then re-activate it (then you see state "Handshaking" and the
EOFException).

As this is easily reproducable for me, I suppose it is not a problem with our
network infrastructure, but a bug in Hudson slave implementation when
reconnecting to the master.


Originally reported by fantasmic, imported from: EOFException on reconnect after network connection loss
  • status: Resolved
  • priority: Major
  • component(s): core
  • label(s): remoting
  • resolution: Cannot Reproduce
  • resolved: 2014-09-07T13:37:45+00:00
  • votes: 2
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

In our network, we repeatedly have problems, that network connection suddenly drops but is available again right away. After that happened, I only see the "Connected to.." popup in Windows taskbar - that's how I recognized the connection loss. I don't know why this happens, and it's usually no problem during work (but network guys couldn't yet give me an answer).

In such a case, a Hudson slave (running on a computer where this happens) terminates (Hudson slave window shows state "Terminated"). After the network connection being available again, the slave tries to reconnect to the master, but it fails. Hudson slave window shows state "Handshaking" and then an EOFException occurs. See following stack:

java.io.EOFException: unexpected stream termination at hudson.remoting.Channel.<init>(Channel.java:312) at hudson.remoting.Channel.<init>(Channel.java:251) at hudson.remoting.Channel.<init>(Channel.java:239) at hudson.remoting.Engine.run(Engine.java:159)

In order to reproduce the problem, simply deactivate your LAN connection in Windows control panel (you will see Hudson slave window showing state "Terminated") and then re-activate it (then you see state "Handshaking" and the EOFException).

As this is easily reproducable for me, I suppose it is not a problem with our network infrastructure, but a bug in Hudson slave implementation when reconnecting to the master.

  • environment: Platform: All, OS: Windows XP
1 attachment

Activity

  1. jenkins-infra-bot commented on Jun 18, 2009

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

      Created an attachment (id=745) Hudson slave windows & error dialog with EOFException

    Created an attachment (id=745)
    Hudson slave windows & error dialog with EOFException

  2. jenkins-infra-bot commented on Sep 22, 2009

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

      Thanks for the instruction to reproduce the problem.

      I believe this is happening because master failed to notice that the connection went down in a timely fashion, thus subsequent attempts from the slave to connect gets rejected (and we aren't nicely telling this problem to the plugin.

      You can verify this by checking what the master says about the slave status, after you disabled the network.

      This is a bug at multiple levels...

    Thanks for the instruction to reproduce the problem.

    I believe this is happening because master failed to notice that the connection
    went down in a timely fashion, thus subsequent attempts from the slave to
    connect gets rejected (and we aren't nicely telling this problem to the plugin.

    You can verify this by checking what the master says about the slave status,
    after you disabled the network.

    This is a bug at multiple levels...

  3. jenkins-infra-bot commented on Sep 22, 2009

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

      Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/TcpSlaveAgentListener.java trunk/hudson/main/remoting/src/main/java/hudson/remoting/Engine.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=22037 Log: JENKINS-3889 JNLP clients now report the reason when the connection is rejected by the master.

    Code changed in hudson
    User: : kohsuke
    Path:
    trunk/hudson/main/core/src/main/java/hudson/TcpSlaveAgentListener.java
    trunk/hudson/main/remoting/src/main/java/hudson/remoting/Engine.java
    trunk/www/changelog.html
    http://fisheye4.cenqua.com/changelog/hudson/?cs=22037
    Log:
    JENKINS-3889 JNLP clients now report the reason when the connection is rejected by the master.

  4. jenkins-infra-bot commented on Sep 22, 2009

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

      Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/slaves/ConnectionActivityMonitor.java http://fisheye4.cenqua.com/changelog/hudson/?cs=22039 Log: JENKINS-3889 In 1.325, I added a ping support so that the master detects dead connections more rapidly. This feature is off by default, until we feel comfortable enough that this feature works correctly.

    Code changed in hudson
    User: : kohsuke
    Path:
    trunk/hudson/main/core/src/main/java/hudson/slaves/ConnectionActivityMonitor.java
    http://fisheye4.cenqua.com/changelog/hudson/?cs=22039
    Log:
    JENKINS-3889 In 1.325, I added a ping support so that the master detects dead connections more rapidly. This feature is off by default, until we feel comfortable enough that this feature works correctly.

  5. jenkins-infra-bot commented on Mar 26, 2012

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

      Is there a permanent fix for this issue? I am seeing this all of a sudden on our slave test machines. Our slave machines were working just fine all this time but out of no where we started to notice this issue.

      Any help would be appreciated!

      Thanks,

      Atiq

    Is there a permanent fix for this issue? I am seeing this all of a sudden on our slave test machines. Our slave machines were working just fine all this time but out of no where we started to notice this issue.

    Any help would be appreciated!

    Thanks,

    Atiq

  6. jenkins-infra-bot commented on Sep 7, 2014

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

      Given the age of this issue and the large number of changes since this was reported, I'm resolving this as 'Cannot Reproduce'.

      If this or a similar issue still occurs on recent Jenkins versions, please file a new issue. Provide as much information about your setup as you can.

    Given the age of this issue and the large number of changes since this was reported, I'm resolving this as 'Cannot Reproduce'.

    If this or a similar issue still occurs on recent Jenkins versions, please file a new issue. Provide as much information about your setup as you can.

  7. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions