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

Log errors for upload directly #173

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

alneberg
Copy link
Contributor

Errors are now logged more or less directly after failure upon exiting the verify_proceed wrapper. Since multiple threads could be appending lines to the log, I changed the format of the log so that each line is valid json but the entire file is unfortunately not. Parsing should be easy enough just reading line by line.

I ran 32 threads (on my laptop though) and multiple threads appending to the file did not cause any issues, but I'm not sure it's a recommended praxis. Safer would be to have a single thread taking care of the logging or keeping a global lock variable in the owning class perhaps.

However, I think there might be better ways of making sure that the bucket and database is in sync which seems to be the ultimate goal of this log.

@alneberg alneberg requested a review from i-oden October 15, 2021 07:12
Copy link
Member

@i-oden i-oden left a comment

Choose a reason for hiding this comment

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

Yes! This is exactly what I had in mind.

@i-oden i-oden merged commit f97f022 into ScilifelabDataCentre:dev Oct 15, 2021
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.

None yet

2 participants