• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None
    • Platform: All, OS: Linux

      We don't see these with p4win, which is why we suspect it is something with the
      hudson plugin.

      Performing sync with Perforce for: //xxx/...
      [workspace] $ p4 workspace -o xxx_inspections Changing P4 Client Root to:
      http://xxx.com:8082/job/xxx/ws/
      Changing P4 Client View to: //xxx/... //xxx/...
      [workspace] $ p4 -s client -i
      Last sync'd change: 101540
      [workspace] $ p4 changes -m 25 //xxx/...
      [workspace] $ p4 describe -s 101661
      [workspace] $ p4 describe -s 101656
      Caught Exception communicating with perforce. Failed to communicate with
      p4FATAL: Unable to communicate with perforce. Failed to communicate with p4
      java.io.IOException: Unable to communicate with perforce. Failed to communicate
      with p4
      at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:340)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:574)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:251)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:225)
      at hudson.model.Run.run(Run.java:771)
      at hudson.model.Build.run(Build.java:85)
      at hudson.model.ResourceController.execute(ResourceController.java:70)
      at hudson.model.Executor.run(Executor.java:82)

          [JENKINS-2062] Occasional Perforce Connection Errors

          yschimke created issue -

          yschimke added a comment -

          Once we get this error, then hudson stops polling perforce completely. i.e. we
          have to restart to get things working again.

          yschimke added a comment - Once we get this error, then hudson stops polling perforce completely. i.e. we have to restart to get things working again.

          digerata added a comment -

          Are you using this in a master/slave hudson configuration?

          The strange thing about this is a few commands get through successfully and then
          the failure hits. Can you give a brief overview of the network setup between
          Hudson and Perforce? (are you going over a WAN or is everything local?)

          digerata added a comment - Are you using this in a master/slave hudson configuration? The strange thing about this is a few commands get through successfully and then the failure hits. Can you give a brief overview of the network setup between Hudson and Perforce? (are you going over a WAN or is everything local?)

          yschimke added a comment -

          We are not using master/slave. We have a single hudson server with 2 build queues.

          I believe all of our projects use the same server, but obviously with separate
          client specs and I think some different p4 users.

          Everything is "fairly" local. i.e. it may be a different subnet but it is
          located in our building in London.

          We have had other errors with logins failing before but this looks like a
          network problem.

          yschimke added a comment - We are not using master/slave. We have a single hudson server with 2 build queues. I believe all of our projects use the same server, but obviously with separate client specs and I think some different p4 users. Everything is "fairly" local. i.e. it may be a different subnet but it is located in our building in London. We have had other errors with logins failing before but this looks like a network problem.

          yschimke added a comment -

          Just noticed this exception in the log, but I'm not sure if it is related.

          Problem: Failed to communicate with p4
          com.tek42.perforce.PerforceException: Failed to communicate with p4
          at
          com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:218)
          at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:26)
          at hudson.plugins.perforce.PerforceSCM.pollChanges(PerforceSCM.java:395)
          at hudson.model.AbstractProject.pollSCMChanges(AbstractProject.java:621)
          at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:253)
          at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:285)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
          at java.util.concurrent.FutureTask.run(FutureTask.java:123)
          at
          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
          at
          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
          at java.lang.Thread.run(Thread.java:595)
          Caused by: java.io.IOException: Write end dead
          at java.io.PipedInputStream.read(PipedInputStream.java:244)
          at java.io.PipedInputStream.read(PipedInputStream.java:305)
          at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
          at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
          at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
          at java.io.InputStreamReader.read(InputStreamReader.java:167)
          at java.io.BufferedReader.fill(BufferedReader.java:136)
          at java.io.BufferedReader.readLine(BufferedReader.java:299)
          at java.io.BufferedReader.readLine(BufferedReader.java:362)
          at
          com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:188)
          ... 11 more

          yschimke added a comment - Just noticed this exception in the log, but I'm not sure if it is related. Problem: Failed to communicate with p4 com.tek42.perforce.PerforceException: Failed to communicate with p4 at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:218) at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:26) at hudson.plugins.perforce.PerforceSCM.pollChanges(PerforceSCM.java:395) at hudson.model.AbstractProject.pollSCMChanges(AbstractProject.java:621) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:253) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:285) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: java.io.IOException: Write end dead at java.io.PipedInputStream.read(PipedInputStream.java:244) at java.io.PipedInputStream.read(PipedInputStream.java:305) at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411) at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:188) ... 11 more

          yschimke added a comment -

          Is there any issue with having multiple build threads on a single hudson server?

          Is the usage of the p4 command line concurrent safe?

          yschimke added a comment - Is there any issue with having multiple build threads on a single hudson server? Is the usage of the p4 command line concurrent safe?

          digerata added a comment -

          Wow, I've never seen an error like this:

          "Caused by: java.io.IOException: Write end dead"

          It is thread safe as long as a single P4Depot object is used for each thread. I
          believe, but am not quite sure, that no matter how many build executors are
          running, only one thread is executing a project's build.

          digerata added a comment - Wow, I've never seen an error like this: "Caused by: java.io.IOException: Write end dead" It is thread safe as long as a single P4Depot object is used for each thread. I believe, but am not quite sure, that no matter how many build executors are running, only one thread is executing a project's build.

          yschimke added a comment -

          We are still getting this a lot.

          It seems to be generally caused by the usage of Piped(In|Out)putStream.
          Googling the message finds a lot of JDK issues closed as won't fix. It seems
          part of the design of the class.

          Basically if the thread of the writing side dies, then the next read will fail.

          • If a thread was providing data bytes
          • to the connected piped output stream, but
          • the thread is no longer alive, then an
          • <code>IOException</code> is thrown.

          http://java.sun.com/j2se/1.4.2/docs/api/java/io/PipedInputStream.html#read()

          yschimke added a comment - We are still getting this a lot. It seems to be generally caused by the usage of Piped(In|Out)putStream. Googling the message finds a lot of JDK issues closed as won't fix. It seems part of the design of the class. Basically if the thread of the writing side dies, then the next read will fail. If a thread was providing data bytes to the connected piped output stream, but the thread is no longer alive, then an <code>IOException</code> is thrown. http://java.sun.com/j2se/1.4.2/docs/api/java/io/PipedInputStream.html#read( )

          digerata added a comment -

          Piped in/out was added for master/slave scenarios. I believe we can make this
          conditional and resort to the original way of doing things if you are local.
          Another thought I had was to retry the command for this type of exception and
          make retries configurable. Let me take a look and see.

          digerata added a comment - Piped in/out was added for master/slave scenarios. I believe we can make this conditional and resort to the original way of doing things if you are local. Another thought I had was to retry the command for this type of exception and make retries configurable. Let me take a look and see.

          yschimke added a comment -

          OK, that explains why we are seeing this now.

          But I am suprised that a Hudson PipedInputStream gets eventually by the p4java
          api. I was assuming that they would be internal to the p4java API.

          let me know if you need me to test a fix.

          yschimke added a comment - OK, that explains why we are seeing this now. But I am suprised that a Hudson PipedInputStream gets eventually by the p4java api. I was assuming that they would be internal to the p4java API. let me know if you need me to test a fix.

            Unassigned Unassigned
            yschimke yschimke
            Votes:
            18 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated: