Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeouts and exceptions #82

Merged
merged 7 commits into from
Apr 14, 2023
Merged

timeouts and exceptions #82

merged 7 commits into from
Apr 14, 2023

Conversation

coot
Copy link
Collaborator

@coot coot commented Apr 13, 2023

  • io-sim: fixed timeouts in presence of exceptions
  • io-sim: code style
  • io-sim: track reason why a thread is blocked
  • io-sim: refactored timeout implementation
  • io-sim: improved TimeoutException Show instance

This is an analogous fix to one applied to thread delays in b6cd525.
Moved NewTimeout closer to UpdateTimeout & CancelTimeout.
@coot coot requested review from bolt12 and dcoutts April 13, 2023 08:58
We need to distinguish between threads blocked on STM and threads
blocked by other operations e.g. `threadDelay` or `throwTo`.   This is
necessary so that we don't accidentally unblock a thread which is
blocked not on STM by updating a TVar on which it was previously
blocked.
@coot coot force-pushed the coot/timeouts-and-exceptions branch from a1656ff to 556324b Compare April 13, 2023 09:02
@coot coot self-assigned this Apr 13, 2023
@coot
Copy link
Collaborator Author

coot commented Apr 13, 2023

The following tests (including nightly ones) passed:

  • network-mux:test
  • ouroboros-network-framework:test
  • ouroboros-network:test

@coot coot force-pushed the coot/timeouts-and-exceptions branch 2 times, most recently from 9385ed9 to 9d2591f Compare April 13, 2023 14:33
io-sim/src/Control/Monad/IOSim/Internal.hs Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Internal.hs Show resolved Hide resolved
io-sim/src/Control/Monad/IOSimPOR/Internal.hs Outdated Show resolved Hide resolved
This patch implements `timeout` in exactly the same way as `timeout` in
`base` for threaded RTS.
Added tips on testing and a two useful tips for debugging.
@coot coot force-pushed the coot/timeouts-and-exceptions branch from 2b18f6b to 28e8022 Compare April 14, 2023 10:15
@coot coot merged commit 9c9d733 into main Apr 14, 2023
@coot coot deleted the coot/timeouts-and-exceptions branch April 14, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants