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

fileserver: stop listing dir when request context is cancelled #5131

Merged
merged 1 commit into from Oct 8, 2022

Conversation

abdusco
Copy link
Contributor

@abdusco abdusco commented Oct 8, 2022

Prevents caddy from performing disk IO needlessly when the request is cancelled before the listing is finished.

Closes #5129

@abdusco abdusco force-pushed the cancel-dir-listing branch 3 times, most recently from b90f2aa to aa2c98c Compare October 8, 2022 05:13
Prevents caddy from performing disk IO needlessly when the request is cancelled before the listing is finished.

Closes caddyserver#5129
@francislavoie francislavoie added under review 🧐 Review is pending before merging optimization 📉 Performance or cost improvements labels Oct 8, 2022
@francislavoie francislavoie added this to the v2.6.3 milestone Oct 8, 2022
@mholt
Copy link
Member

mholt commented Oct 8, 2022

Thanks! This LGTM. Did this improve performance for you?

@abdusco
Copy link
Contributor Author

abdusco commented Oct 8, 2022

@mholt it helped. Caddy now stops listing at the first chance it gets, check this out: #5129 (comment)

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Oh, awesome -- somehow I didn't see that comment. Thanks for the improvement!

@mholt mholt merged commit 33f60da into caddyserver:master Oct 8, 2022
@mholt mholt modified the milestones: v2.6.3, v2.6.2 Oct 8, 2022
@abdusco abdusco deleted the cancel-dir-listing branch October 8, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization 📉 Performance or cost improvements under review 🧐 Review is pending before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop stating files in dir when request context is cancelled
3 participants