Open
Description
Specification
Currently, there is no way to cancel or abort an operation after it has been started. This is especially an issue for commands which can run for an arbitrarily long time. For example, the efs.readFile()
can take extremely long to complete depending on the file.
If this operation is being used in, say, a RPC call, and the RPC call times out, then the operation will continue to run in the background. This will keep a connection and a file descriptor open in the background and not do anything with it, resulting in leaked resources and blocking the entire application from shutting down.
The easiest way to achieve this is to accept either a context object from js-contexts, or just accept an AbortController.signal
.
Additional context
- Polykey agent not shutting down gracefully Polykey-CLI#185
Tasks
- Implement support for abortion or cancellation
- Add tests to confirm this behaviour