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

Parent's shutdown function executes in child processes #9

Closed
TheLevti opened this issue Feb 1, 2020 · 0 comments
Closed

Parent's shutdown function executes in child processes #9

TheLevti opened this issue Feb 1, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@TheLevti
Copy link
Owner

TheLevti commented Feb 1, 2020

The travis ci pipeline sometimes fails randomly on the ProcessManagerTest::testLargeBatchProcessing test. In addition to the issue specified in #7, the pipeline also randomly fails with the same error, but for a different reason.

The output of this bug is then the following:

There was 1 failure:

1) Spork\ProcessManagerTest::testLargeBatchProcessing with data set #0 (10)
null does not match expected type "array".

Cause

The shutdown function is triggered several times if a ProcessManager's child process spawns their own children. No other test covered this scenario except of the batch processor tests. This behavior would sometimes cause the shared memory block to be already initialized by one of the processes child process. The parent then would fail on the shutdown function, because of the already existing block, which is in addition shorter than what is required for the message. This would cause unserialize to fail because of a cut off message.

Fix

Because it is not possible to unregister a shutdown function (once the child process is spawned), the solution to use shutdown functions is not ideal and should be changed in a later iteration. The current solution would be to check inside the shutdown function whether the passed process id is still the same when the function is executed. If not then it shall do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant