haskell-distributed / distributed-process-platform

DEPRECATED (Cloud Haskell Platform) in favor of distributed-process-extras, distributed-process-async, distributed-process-client-server, distributed-process-registry, distributed-process-supervisor, distributed-process-task and distributed-process-execution
http://haskell-distributed.github.com
BSD 3-Clause "New" or "Revised" License
47 stars 17 forks source link

GenProcess `call` interrupt results in chaos #63

Closed hyperthunk closed 11 years ago

hyperthunk commented 11 years ago

I'm pretty sure this is a bug. If a callback decides to terminate mid-way through a gen-call it can create havoc for the client if they're monitoring the server. The bit that really worries me is this:

Mon Jan 21 17:34:13 UTC 2013 pid://127.0.GenServerTests: 0.too few bytes. Failed reading at byte position 651
:8080:0:6: terminating....
Mon Jan 21 17:34:13 UTC 2013 pid://127.0.0.1:8080:0:6: terminating counter when state = 10 because TerminateOther "Count > 10"
Mon Jan 21 17:34:13 UTC 2013 pid://127.0.0.1:8080:0:58: call: remote process died: DiedNormal
  exceed counter limits: [Failed]
ERROR: thread blocked indefinitely in an MVar operation

Now if we ignore the odd stdio interleaving, the key thing I'm concerned about is that the decoding of some message has blown up. Quite why this is happening, I'm not sure, though This might be to do with the use of terminate or (previously) fail in the async call worker process, but it's pretty awkward to debug.

hyperthunk commented 11 years ago

Turns out this was a silly bug in the Binary instance for ProcessExitException. Resolved with a fix in d-process for now.