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

Add Ctx for cancellation to BlockPersistence.WriteNextBlock() #1275

Open
ronnno opened this issue Aug 11, 2019 · 2 comments
Open

Add Ctx for cancellation to BlockPersistence.WriteNextBlock() #1275

ronnno opened this issue Aug 11, 2019 · 2 comments

Comments

@ronnno
Copy link
Contributor

ronnno commented Aug 11, 2019

and possibly other adapter methods.
all IO bound operations must be cancellable

@electricmonk electricmonk added the good first issue Good for newcomers label Oct 6, 2019
@vistra
Copy link
Collaborator

vistra commented Oct 6, 2019

This may be a bit tricky as file operations don't take context.
This may be achievable using write timeouts and retries, or using low level methods (e.g. closing a file descriptor from another thread).

Also - need to make sure that if a cancellation happens in the middle of a sequence of write operations, the file is not remained corrupted due to partial writes.

See related proposal, which also suggests alternative solutions - golang/go#20280

@vistra vistra removed the good first issue Good for newcomers label Oct 15, 2019
@ronnno
Copy link
Contributor Author

ronnno commented Nov 5, 2019

The current filesystem adapter withstands interrupted writes. no need to guarantee a write has completed once began. the reader ignores partial or invalid entries and assumes the file ended in the last valid block.

However, it is a challenge to interrupt file operations..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants