Comments (6)
I don't think the issue is that we cannot spawn a closure on master -- when I run your example with just a single node (i.e. the master only), and stick in a threadDelay to make sure the master does not exit before it gets a chance to print the log message, it prints the result of isPrime and then shows the same MVar error that you're showing. I'll investigate.
from distributed-process.
Awesome.
from distributed-process.
It's related to spawnLink (as opposed to spawn).
from distributed-process.
Yes I saw it in every variant/extension of spawn too.
from distributed-process.
Right, so: the new implementation of Cloud Haskell follows the semantics described in "A Unified Semantics for a Future Erlang". In this semantics, linking makes no distinction between regular termination and abnormal termination. In other words, if you link to a process, and that process dies normally, you die too. This is appropriate for slave processes that link to their masters, where the master should never terminate (masters should monitor their slaves, not link to them). In your example, you are linking to the processes that compute the prime numbers. As soon as this process terminates, the process that spawned it will die too.
The "thread blocked indefinitely" exception you were seeing was a bug, however. The backend starts the master process using "runProcess", which waits for a process to finish -- but it didn't take into account abnormal termination and would beb blocked indefinitely when the process threw an exception. I have fixed this and released it as 0.2.2.0 to Hackage.
If you run your example again (and insert a threadDelay to give the spanwed processes a chance to do anytihng) you will find that the program will now terminate quietly, possibly after or possibly before the log message.
So in summary: you shouldn't use spawnLink here, but you did find a bug. Thanks for the report :)
from distributed-process.
Awesome thanks for the update. I was mostly concerned because I didn't see the same behavior in the original 'remote' package (it waits for the spawnLink'ed processes to finish before the main exits) and also the mvar thread lock message.
from distributed-process.
Related Issues (20)
- Could not deduce (MonadFail Process) arising from a use of ‘fail’ HOT 1
- whereisRemoteAsync does not work via LAN HOT 1
- maintainance issue w.r.t. STM dependency & GHC version compatibility
- broken link in repo description HOT 3
- Generalize call to take a `Closure (SerializableDict a)`
- Revamp/Update CI
- Revamp CI on distributed-process
- Evaluate CI providers HOT 3
- Would it be possible to send and receive CH messages from potentially untrusted sources HOT 1
- Support for distributed traces
- Revamp docs site on distributed process
- Establish support window & upgrade plan
- Address Intermittently failing tests HOT 1
- Remove rematch dependency in distributed-process-tests HOT 1
- Build failure with ghc-9.2.4 `Expecting one more argument to ‘TyVarBndr’` HOT 2
- Can’t build with GHC 9.2.5 HOT 1
- No instance for (binary-0.8.5.1:Data.Binary.Class.Binary Main.Message) HOT 1
- New release? HOT 5
- Add LaurentRDC to the hackage maintainers list HOT 3
- Add davidsd and LaurentRDC to hackage maintainers list for `distributed-process-tests` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distributed-process.