-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fixed CreatorData destructor #666
Conversation
Codecov Report
@@ Coverage Diff @@
## master #666 +/- ##
==========================================
+ Coverage 84.78% 84.92% +0.13%
==========================================
Files 98 98
Lines 4225 4231 +6
Branches 1890 1892 +2
==========================================
+ Hits 3582 3593 +11
+ Misses 642 637 -5
Partials 1 1
Continue to review full report at Codecov.
|
@veloman-yunkan Do we have an easy way to test this scenario? Maybe at zimwriterfs level? I have also tried this patch with zimwriterfs and now it seems to leave the process too early. I don't get my ZIM file, the |
7c0b4fc
to
1bdc00c
Compare
@kelson42 I have added a new unit-test targeting that scenario here in libzim
What is the desired behaviour? Are you concerned that the |
I'm a bit concerned to open the Pandora box, but let's go:
|
In this particular case, the absence of information about the error is caused by an empty message string in Lines 80 to 87 in c0486c3
|
@veloman-yunkan OK... the dev was not well inspired here ;) We should at least fix this IMO. Something like "Unable to open , file does not exist or is not readable." |
@veloman-yunkan Now at least, with #667, on the top, the process does not crash and we have a meaningfull error! |
@kelson42 Though the error was still a little strange. #668 made it more elaborate, highlighting that the problem is with too many open files. |
@veloman-yunkan I have merged #668 and with increasing the max limit of files open with So now I see the following questions/bugs left:
Maybe you have already answers or we should open tickets? Let me know your opinion please. |
The new unit test tries to provide some evidence that interrupted creation of a ZIM file (when `zim::Creator` is destroyed without `zim::Creator::finishZimCreation()` having been called) doesn't end up similar to openzim/zim-tools#289. So far this is not the case, that's why the new unit-test fails with a crash.
Clusters owned by `CreatorData` are used in the worker threads. If the `CreatorData` destructor is executed as a result of stack unwinding caused by an exception raised before `CreatorData::quitAllThreads()` is called from `Creator::finishZimCreation()`, then the worker threads are still running and should be stopped by the `CreatorData::quitAllThreads()` call from `CreatorData::~CreatorData()`. However, that must happen *before* the clusters are destroyed.
1bdc00c
to
17a6a59
Compare
961ac34
to
34fc632
Compare
That PR (#603) only addressed a successful ZIM creation flow. I have now added to this PR a commit that removes the ".zim.tmp" temporary file in case of a failed flow. |
The test-suite of
I don't have a ready answer to this question. I don't think that it will be difficult to find out but let's better do it under a different ticket. |
The failing CI on Macos is not related to this change. I'm merging |
Fixes openzim/zim-tools#289
Clusters owned by
CreatorData
are used in the worker threads. If theCreatorData
destructor is executed as a result of stack unwinding caused by an exception raised beforeCreatorData::quitAllThreads()
is called fromCreator::finishZimCreation()
, then the worker threads are still running and should be stopped by theCreatorData::quitAllThreads()
call fromCreatorData::~CreatorData()
. However, that must happen before the clusters are destroyed.