-
Notifications
You must be signed in to change notification settings - Fork 151
Correctly cleanup file when a S3 upload is succesfully #123
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
Conversation
The TemporaryFile#delete! method was raising an exception because we raryFile#delete! method was raising an exception because we were trying to close a file that was already close, since the on_complete is executed in a thread nothing was present to catch and log that specific error and the thread would just end up getting killed. This PR add guards for closing an already close file, also add test around the stale file uploader checker to make sure only 1 file is remaining on disk after roration. For future debugging purpuse we also log any error that can occur in the uploader callback. Fixes: #122 #120
| subject.register | ||
| subject.multi_receive_encoded(batch) | ||
| sleep(1) # the periodic check should have kick int | ||
| sleep(5) # the periodic check should have kick in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give it a bit more time to do his stuff before doing any assert seems to reduce a lot of the noise.
suyograo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Should we be using |
|
@joshuaspence This is a good point, I will make another PR with
|
|
Thanks! |
The TemporaryFile#delete! method was raising an exception because we
were trying to close a file that was already close, since the
on_completeis executed in a thread nothing was present to catch andlog that specific error and the thread would just end up getting killed.
This PR add guards for closing an already close file, also add test
around the stale file uploader checker to make sure only 1 file is
remaining on disk after rotation.
For future debugging we also log any error that can occur in the
uploader callback.
Fixes: #122 #120