typesafehub / akka-contrib-extra

ConductR Akka contributions
Other
9 stars 16 forks source link

Provide a non-blocking process implementation #60

Closed huntc closed 7 years ago

huntc commented 7 years ago

Utilises NuProcess in order to provide a non-blocking process implementation for Windows, OS X and Linux.

Authors: @longshorej and @huntc

huntc commented 7 years ago

@ktoso ... in case you're interested in reviewing further :-)

@longshorej ... in case you're interested integrating with our code base - we'll need to cherry pick changes to an Akka 2.4 flavour of this lib though (shouldn't be hard).

longshorej commented 7 years ago

Branch created @ https://github.com/typesafehub/akka-contrib-extra/tree/3.0, I'll backport this PR once merged.

huntc commented 7 years ago

Hey, @viktorklang - would you care to review - I think this PR would be right up your alley. :-)

huntc commented 7 years ago

Tests are failing fairly consistently on Travis with:

[info] - should read from stdin and write to stdout *** FAILED ***
[info]   java.lang.AssertionError: assertion failed: timeout (6 seconds) during expectMsg:
...
[info]   at akka.contrib.process.NonBlockingProcessSpec$$anonfun$1$$anonfun$apply$mcV$sp$4.apply(NonBlockingProcessSpec.scala:39)

I don't seem to be able to reproduce this locally. I've enhanced the test build config to cut out parallelism etc. but still no cigar...

huntc commented 7 years ago

Update on https://github.com/typesafehub/akka-contrib-extra/pull/60#issuecomment-322401257

I can reproduce this problem with reasonable consistency on Linux - harder to reproduce when invoking the "read from stdin and write to stdout" test, but not impossible. There may still be something racey about my custom graph...

huntc commented 7 years ago

@longshorej I've disabled that test you added a while back in the interest of pushing this forward. Would you mind re-visiting that test? It isn't making much sense to me. For starters, the test declares, "detect when a process has exited of its own accord", but it isn't - a Destroy is being sent...

huntc commented 7 years ago

@longshorej I’ve re-instated that test of yours for NonBlockingProcess and implemented the polling on /proc. Unfortunately, the test fails on Linux (passing just fine on OS X). I’ve run out of time today, but I was wondering if you could continue taking a look at it...