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

High CPU when file being uploaded is rotated #1125

Closed
mkrokosz opened this issue Aug 19, 2020 · 2 comments
Closed

High CPU when file being uploaded is rotated #1125

mkrokosz opened this issue Aug 19, 2020 · 2 comments
Assignees
Milestone

Comments

@mkrokosz
Copy link

mkrokosz commented Aug 19, 2020

If a file being uploaded is rotated, a race condition in object_put() between opening the stream and calculating the length will cause this function to get stuck in a while loop because it will be trying to read more bytes then exist in the file which this function opens. When this occurs, read will return 0 bytes causing this function to get stuck into a while loop causing the script to peg a single core to 100% cpu.

chunk = f.read(min(8192, size_left))

@fviard fviard self-assigned this Aug 20, 2020
@fviard fviard added this to the 2.2.0 milestone Aug 20, 2020
@fviard
Copy link
Contributor

fviard commented Aug 20, 2020

Thank you very much for your detailed report!
I'm especially grateful to you for having investigated the root cause of this tricky corner case, so that now the fix will be easy.

@fviard fviard closed this as completed in ee4b303 Apr 25, 2021
@fviard
Copy link
Contributor

fviard commented Apr 26, 2021

Finally fixed, thank you very much!

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

No branches or pull requests

2 participants