{"action":"created","issue":{"url":"https://api.github.com/repos/Hopac/Hopac/issues/78","labels_url":"https://api.github.com/repos/Hopac/Hopac/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/Hopac/Hopac/issues/78/comments","events_url":"https://api.github.com/repos/Hopac/Hopac/issues/78/events","html_url":"https://github.com/Hopac/Hopac/issues/78","id":104043060,"number":78,"title":"Scheduler stops running jobs","user":{"login":"vasily-kirichenko","id":873919,"avatar_url":"https://avatars.githubusercontent.com/u/873919?v=3","gravatar_id":"","url":"https://api.github.com/users/vasily-kirichenko","html_url":"https://github.com/vasily-kirichenko","followers_url":"https://api.github.com/users/vasily-kirichenko/followers","following_url":"https://api.github.com/users/vasily-kirichenko/following{/other_user}","gists_url":"https://api.github.com/users/vasily-kirichenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vasily-kirichenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasily-kirichenko/subscriptions","organizations_url":"https://api.github.com/users/vasily-kirichenko/orgs","repos_url":"https://api.github.com/users/vasily-kirichenko/repos","events_url":"https://api.github.com/users/vasily-kirichenko/events{/privacy}","received_events_url":"https://api.github.com/users/vasily-kirichenko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-31T12:16:48Z","updated_at":"2015-08-31T13:20:22Z","closed_at":null,"body":"40 threads from the standard thread pool call `run <a Hopac job>`.\r\nAfter a hour or two everything stops working.\r\nAll the thread pool threads are waiting on `run ...`.\r\nAll Hopac threads are in the following state:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/873919/9578468/f1d358cc-4ff2-11e5-91b6-9353ec1787b9.png)\r\n\r\nI think the position is a bit wrong and it waits on Condition.Wait:\r\n```\r\nmscorlib.dll!System.Threading.Monitor.Wait(object obj) + 0x1e bytes\t\r\nHopac.dll!Hopac.Scheduler.run<Microsoft.FSharp.Core.FSharpChoice<Microsoft.FSharp.Core.FSharpOption<KlSrl.Storage.FileWithHashes>,System.Exception>>(Hopac.Scheduler sr, Hopac.Job<Microsoft.FSharp.Core.FSharpChoice<Microsoft.FSharp.Core.FSharpOption<KlSrl.Storage.FileWithHashes>,System.Exception>> xJ) Line 644\tF#\r\n```"},"comment":{"url":"https://api.github.com/repos/Hopac/Hopac/issues/comments/136368958","html_url":"https://github.com/Hopac/Hopac/issues/78#issuecomment-136368958","issue_url":"https://api.github.com/repos/Hopac/Hopac/issues/78","id":136368958,"user":{"login":"VesaKarvonen","id":5804945,"avatar_url":"https://avatars.githubusercontent.com/u/5804945?v=3","gravatar_id":"","url":"https://api.github.com/users/VesaKarvonen","html_url":"https://github.com/VesaKarvonen","followers_url":"https://api.github.com/users/VesaKarvonen/followers","following_url":"https://api.github.com/users/VesaKarvonen/following{/other_user}","gists_url":"https://api.github.com/users/VesaKarvonen/gists{/gist_id}","starred_url":"https://api.github.com/users/VesaKarvonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VesaKarvonen/subscriptions","organizations_url":"https://api.github.com/users/VesaKarvonen/orgs","repos_url":"https://api.github.com/users/VesaKarvonen/repos","events_url":"https://api.github.com/users/VesaKarvonen/events{/privacy}","received_events_url":"https://api.github.com/users/VesaKarvonen/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T13:20:22Z","updated_at":"2015-08-31T13:20:22Z","body":"Hmm... Are you sure that run is not being called from a Hopac thread? If we can trust that the Hopac threads really are in the run function, then it would suggest that run is being called from a Hopac thread.\r\n\r\nIf you call run from some (non Hopac) thread and then abort it, then what might happen is that the thread might still be running the job (Hopac starts running the job on the thread that calls run) and it would mean that the job would also effectively abort.  The stack trace you quoted shows that the thread was in Monitor.Wait, which suggests that the thread was no longer running the job, but merely waiting for it to finish.  In that case the job should continue running in Hopac threads until it is finished."}}