Skip to content

Make workers by default not call parent's at_exit handlers at exit #230

@dpsi

Description

@dpsi

Cucumber unfortunately utilizes the at_exit method as hook. The Parallel gem by default uses the Kernel#fork method which means that when the forked process exits, it will call the parent's at_exit handler. I am not sure if this is intended behaviour for the Parallel gem, but it does cause some unexpected bugs to occur in cucumber, or any other program that uses at_exit in a similiar way. Capybara, minitest, are some others I think use at_exit like this.

Here is the issue I opened with cucumber: cucumber/cucumber-ruby#1327

I was wondering if there was any interest in making Thread the default, or perhaps changing how the #fork workers exit. I think calling exit! will make it not call the parents at_exit handlers, but calling that from inside the Parallel block (in user code) ended up with Deadworker exception which makes sense after perusing the code.

PS: I love how this gem is essentially 1 file, very nice concise code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions