Closed MasseGuillaume closed 6 years ago
This is the full context:
In scastie, I was happily using the NonBlockingProcess.
At some point, we restarted the server and this is when all hell breaks loose. I started getting those errors:
Exception in thread "NuProcessLinuxCwdChangeable-1" java.lang.RuntimeException: unshare(CLONE_FS) failed, return code: -1, last error: 1
at com.zaxxer.nuprocess.internal.BasePosixProcess.checkReturnCode(BasePosixProcess.java:793)
at com.zaxxer.nuprocess.internal.BasePosixProcess$LinuxCwdThreadFactory$1.run(BasePosixProcess.java:97)
at java.lang.Thread.run(Thread.java:748)
I decided, to switch to BlockingProcess to avoid getting this error.
https://github.com/scalacenter/scastie/commit/f871bf90f0df8c62d6d788f2ec856996f0f69148
If I send some bytes to stdin, how is it possible to flush them?
flush()
is called only on stream completion.
You can pass in autoFlush = true
to fromOutputStream
to flush everytime a new element is written.
At some point, we restarted the server and this is when all hell breaks loose
Are these related to flushing?
Either way looks like unshare
returned a failure. This might want a ticket in https://github.com/brettwooldridge/NuProcess
@2m
I think autoFlushStdIn: Boolean
should be exposed in the BlockingProcess.props
https://github.com/typesafehub/akka-contrib-extra/blob/078eb4745e50c5b21051f67d1f79c0415085c04c/src/main/scala/akka/contrib/process/BlockingProcess.scala#L82-L86
created: https://github.com/brettwooldridge/NuProcess/issues/84
@MasseGuillaume NuProcess v1.2.0 fixes the "unshare(CLONE_FS)" issue.
In BlockingProcess the stdin is wrapped in a Stream:
https://github.com/typesafehub/akka-contrib-extra/blob/078eb4745e50c5b21051f67d1f79c0415085c04c/src/main/scala/akka/contrib/process/BlockingProcess.scala#L150-L152
If I send some bytes to stdin, how is it possible to flush them?