- Saved searches
- Use saved searches to filter your results more quickly
- error starting build pod java.io.IOException: Pipe not connected #206
- error starting build pod java.io.IOException: Pipe not connected #206
- Comments
- «Труба не подключена» к сыну Java Callable
- Saved searches
- Use saved searches to filter your results more quickly
- IOException: Pipe not connected in TestCluster #1243
- IOException: Pipe not connected in TestCluster #1243
- Comments
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error starting build pod java.io.IOException: Pipe not connected #206
error starting build pod java.io.IOException: Pipe not connected #206
Comments
Seems to happen when there’s low resources or multiple jobs running. This has been seen on OSO and GKE.
Executing shell script inside container [maven] of pod [kubernetes-137ebf2065f949d4acac4e019ed07af7-1e96524904d1e] [Pipeline] > [Pipeline] // container [Pipeline] > [Pipeline] // node [Pipeline] > [Pipeline] // podTemplate [Pipeline] > [Pipeline] // podTemplate [Pipeline] End of Pipeline GitHub has been notified of this commit’s build result java.io.IOException: Pipe not connected at java.io.PipedOutputStream.write(PipedOutputStream.java:140) at java.io.OutputStream.write(OutputStream.java:75) at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.launch(ContainerExecDecorator.java:125) at hudson.Launcher$ProcStarter.start(Launcher.java:384) at org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:157) at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:63) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:172) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108) at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16) at stageProject.call(/var/jenkins_home/jobs/fabric8-cd/jobs/fabric8-maven-plugin/branches/master/builds/16/libs/github.com/fabric8io/fabric8-pipeline-library/vars/stageProject.groovy:18) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor239.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at com.cloudbees.groovy.cps.Next.step(Next.java:74) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Finished: FAILURE
The text was updated successfully, but these errors were encountered:
«Труба не подключена» к сыну Java Callable
Я хочу, чтобы труба для связи от отца к вызываемому в пуле потоков. Однако труба кажется «не связана» с самого начала. Если вместо этого я использую Runnable, проблема исчезнет. Я извлек упрощенный пример:
public class Test < public static void main (String[] args) throws IOException, InterruptedException < ExecutorService es = Executors.newCachedThreadPool(); PipedInputStream a = new PipedInputStream(); // create a list of Callables (one element) and invoke them Son x=new Son(a); List> ls = new LinkedList<>(); ls.add(x); es.invokeAll(ls); // create a line oriented pipe PrintWriter toSon = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new PipedOutputStream(a))),true); //write anything toSon.println("blah blah blah"); //here you can add a Thread.sleep, no change toSon.close(); > >
public class Son implements Callable < PipedInputStream x; public Son(PipedInputStream x) < this.x=x; >public Object call() < BufferedReader b = new BufferedReader( new InputStreamReader( new BufferedInputStream(x))); try < System.out.println(">"+b.readLine()); > catch (IOException e) < e.printStackTrace(); >return null; > >
java.io.IOException: Pipe not connected at java.io.PipedInputStream.read(PipedInputStream.java:306) at java.io.PipedInputStream.read(PipedInputStream.java:378) at java.io.BufferedInputStream.read1(BufferedInputStream.java:273) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:154) at java.io.BufferedReader.readLine(BufferedReader.java:317) at java.io.BufferedReader.readLine(BufferedReader.java:382) at prova.Son.call(Son.java:23) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOException: Pipe not connected in TestCluster #1243
IOException: Pipe not connected in TestCluster #1243
Comments
TestCluster sometimes throws strange IOExcepton .
04:30:08 00:03.028 org.h2.test.db.TestCluster FAIL org.h2.message.DbException: IO Exception: "java.io.IOException: Pipe not connected" 90028 ERROR: FAIL (mvStore ) org.h2.message.DbException: IO Exception: "java.io.IOException: Pipe not connected" 90028 org.h2.message.DbException: IO Exception: "java.io.IOException: Pipe not connected" 90028 ------------------------------ org.h2.message.DbException: IO Exception: "java.io.IOException: Pipe not connected" 90028 at org.h2.message.DbException.get(DbException.java:171) at org.h2.message.DbException.convertIOException(DbException.java:354) at org.h2.util.ScriptReader.readStatement(ScriptReader.java:101) at org.h2.tools.RunScript.execute(RunScript.java:165) at org.h2.tools.CreateCluster.performTransfer(CreateCluster.java:136) at org.h2.tools.CreateCluster.process(CreateCluster.java:113) at org.h2.tools.CreateCluster.runTool(CreateCluster.java:84) at org.h2.tools.CreateCluster.main(CreateCluster.java:51) at org.h2.test.db.TestCluster.testCreateClusterAtRuntime(TestCluster.java:336) at org.h2.test.db.TestCluster.test(TestCluster.java:45) at org.h2.test.TestBase.runTest(TestBase.java:132) at org.h2.test.TestAll.addTest(TestAll.java:1003) at org.h2.test.TestAll.testAdditional(TestAll.java:909) at org.h2.test.TestAll.runTests(TestAll.java:636) at org.h2.test.TestAll.testAll(TestAll.java:550) at org.h2.test.TestAll.run(TestAll.java:500) at org.h2.test.TestAll.main(TestAll.java:441) Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.IOException: Pipe not connected" 90028 at org.h2.message.DbException.getJdbcSQLException(DbException.java:394) . 17 more Caused by: java.io.IOException: Pipe not connected at java.base/java.io.PipedReader.read(PipedReader.java:293) at org.h2.util.ScriptReader.readBuffer(ScriptReader.java:281) at org.h2.util.ScriptReader.read(ScriptReader.java:254) at org.h2.util.ScriptReader.readStatementLoop(ScriptReader.java:107) at org.h2.util.ScriptReader.readStatement(ScriptReader.java:99) . 14 more
The most likely reason is that threadFuture is returned before PipedWriter is connected with PipedReader .
try ( PipedReader pipeReader = new PipedReader ()) |
Future threadFuture = startWriter ( pipeReader , statSource ); |
PipedWriter is created in a separate thread and there is no barrier to delay return until it is initialized:
Future >threadFuture = thread . submit ( new Runnable () |
@ Override |
public void run () |
// If the creation of the piped writer fails, the reader will |
// throw an IOException as soon as read() is called: IOException |
// — if the pipe is broken, unconnected, closed, or an I/O error |
// occurs. The reader’s IOException will then trigger the |
// finally<> that releases exclusive mode on the source DB. |
try ( final PipedWriter pipeWriter = new PipedWriter ( pipeReader ); |
final ResultSet rs = statSource . executeQuery ( «SCRIPT» )) |
while ( rs . next ()) |
pipeWriter . write ( rs . getString ( 1 ) + » \n » ); |
> |
> catch ( SQLException | IOException ex ) |
throw new IllegalStateException ( «Producing script from the source DB is failing.» , ex ); |
> |
> |
>); |
thread . shutdown (); |
return threadFuture ; |
May be it should be initialized in the main thread instead.
The text was updated successfully, but these errors were encountered: