-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Thread exception #496
Thread exception #496
Conversation
Codecov ReportBase: 84.67% // Head: 84.93% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #496 +/- ##
==========================================
+ Coverage 84.67% 84.93% +0.26%
==========================================
Files 98 98
Lines 4325 4387 +62
Branches 1869 1913 +44
==========================================
+ Hits 3662 3726 +64
+ Misses 661 660 -1
+ Partials 2 1 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
1748b31
to
de4367c
Compare
ff82021
to
29d7104
Compare
@mgautierfr How much work is needed here to complete this PR? |
29d7104
to
80b962d
Compare
Tests are failing because we don't wait enough to have the threads "detecting" the error. |
80b962d
to
66964e9
Compare
@mgautierfr All CI does not pass unfortunately. A header/pragma might be missing ;) |
Indeed, it is usleep on Windows. |
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.
- Some of the errors checked by the new unit test come from
ASSERT
s that are disabled in a release build. This will lead to bug reports similar to The reader test seems to stuck in a deadlock (zim-testing-suite) for some reason. #670 (see The reader test seems to stuck in a deadlock (zim-testing-suite) for some reason. #670 (comment)). - Handling of errors during ZIM creation must be documented.
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.
Please rebase/fixup and clean the history of this PR for the next (hopefully, final) review
@mgautierfr I have updated to comment to say it "fixes #475". Hope this is correct. |
22ab65e
to
1e22719
Compare
The concerns raised in the first review have not been addressed:
|
Fixed. (I will move the three new commits a bit upper in the git history when rebase-fixup) |
8c8e8ea
to
3d939b9
Compare
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.
There were a few typos in the documentation, but I guess you can fix them as you rebase and fixup.
4e95a8e
to
44956e9
Compare
a2d40fe
to
487fabc
Compare
Last push-force split a commit in the history ( |
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.
Please fix the only last comment, and rebase-fixup for formal approval to merge.
Creator is based on API the user have to implement. If the user create buggy code or throw exception, we must be prepared to handle them. The new tests show some use cases (all ?) we must be prepared to handle. They are not handle now, will be in next commits.
- Introduce a std::exception_ptr slot to be able to pass a exception from the worker threads to the main thread. - Check the slot on each entry point called from the main thread. - Put the creator "in error" if the exception is set. - Raise a exception if the creator is in error.
There is no good solution as the value depend of the computer: - Too long and user wait too much for their tests to run - Too short and the tests are failing Let's use a default value and allow user to change the value using a factor defined in WAIT_TIME_FACTOR_TEST env variable.
487fabc
to
b9ac991
Compare
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. You know why I didn't approve.
This avoid code duplication around waiting_task.
This way we can test that it is the expect exception which is thrown and not another one.
b9ac991
to
76ad28e
Compare
Done :) |
* Optimization ofthe first call to `zim::Archive::iterEfficient` (@veloman-yunkan #724) * Add some documentation to `zim::writer::IndexData` (@mgautierfr #727) * Correctly catch and rethrow exception thrown in worker threads at creation (@mgautierfr #496 #748) * Optimization of `Entry::getItem()` (@veloman-yunkan #732) * Fix declaration of `zim::setICUDataDirectory()` (@MohitMaliFtechiz #733) * Add `zim::Archive::getMediatCount()` (@mgautierfr #730) * Make compilaton of examples optional (@mgautierfr #738) * Add a CI for wasm (@mgautierfr #746) * Make constructor of SuggestionItem public (@veloman-yunkan #740)
This is a draft PR, just to track the branch.Now ready to reviewFixes #475
Fixes openzim/python-libzim#153