-
Notifications
You must be signed in to change notification settings - Fork 165
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
RotatingFileHandler gives ValueError: I/O operation on closed file #136
Comments
It looks like this only happens on Windows machines and never Linux machines. <--- Insert Windows rant here. |
Can you provide a minimally working example, so I can try to reproduce? I assume |
I'm running into this issue on CentOS 6.6:
|
Good point @RazerM: @simpleseeker, @codeape could any of you provide a minimal example of that so that we can write a test about it? |
I ran into this on ubuntu as well. |
@vikram-narayan, can you paste/point us to a small example, please? |
I've managed to produce a minimal flask app that recreates this Looks like if the log is already full and you try to write to it, it attempts to rotate the file and fails first due to a permission error in windows (see the Output.txt file in the gist), then every subsequent attempt fails with "I/O operation on closed file" |
Thanks @veaviticus, I wonder if this is related to how Flask's auto-reloading works. Edit: Yeah it only happens when |
That would explain why I've only seen on my local machine and not in the production app using logbook yet. And as long as you don't leave the log around forever when debugging, it's not really a huge issue |
I was debugging issue getlogbook#136 and noticed this.
Confirming the same problem on Linux:
It seems like |
Hit this on Windows, running with dbt. Had a large number of threads (14), and I believe the log directory is over the network
Potentially related to dbt-labs/dbt-core#3399 |
My application starts to throw ValueError when it rotates files:
After this there is no return, the file will not rotate and these messages keep on showing up.
My application only uses gevent greenlets and I do not use ordinary threads anywhere. This is the start script of my application.
The text was updated successfully, but these errors were encountered: