Skip to content

Feat/ctx cancelable read#16

Open
J-Zeitler wants to merge 4 commits into
rclone:masterfrom
J-Zeitler:feat/ctx-cancelable-read
Open

Feat/ctx cancelable read#16
J-Zeitler wants to merge 4 commits into
rclone:masterfrom
J-Zeitler:feat/ctx-cancelable-read

Conversation

@J-Zeitler
Copy link
Copy Markdown

rclone serve s3 currently does not propagate a cancelled request to the io/file reader level. This PR introduce support for checking context Err()s on every read.

some context/use case: I'm using rclone serve to expose a zfs dataset stored on mechanical disks. I sometimes accidentally (or just to check if possible/how fast stuff is) issue s3 queries that would scan a lot of this dataset. Realizing such a command will take too much time I'll ctrl+c, but the server will still execute the command to completion. In my case that equates to 99% disk usage for a long time, possibly preventing/stalling actual io ops I want to execute.

Copy link
Copy Markdown
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very useful - thank you :-)

I put some minor comments inline.

Comment thread util.go
Comment thread util.go Outdated
Comment thread util.go Outdated
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

Successfully merging this pull request may close these issues.

2 participants