8000 Create new process group for pgcopydb initialization. by shubhamdhama · Pull Request #211 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Create new process group for pgcopydb initialization. #211

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

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

shubhamdhama
Copy link
Contributor

Previously, when pgcopydb encountered a FATAL error and called copydb_fatal_exit, any wrapper processes around pgcopydb would also get terminated due to the if (kill(0, SIGTERM) == -1) statement. To fix this issue, a new process group is now created for pgcopydb during initialization. This ensures that only the pgcopydb process will be terminated in case of a FATAL error, leaving the wrapper processes intact.

Comment on lines 46 to 47
/* create a new process group and set current process as its leader. This
* allows the process group to be easily controlled, without affecting any
Copy link
Owner

Choose a reason for hiding this comment

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

Nitpicking: please conform to the comment style used in the rest of the project. It would then look like this:

    /*
     * Create a new process group...
     * 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@shubhamdhama shubhamdhama force-pushed the fix-pgcopydb-killing-wrapper branch from 0dbbd2e to f055201 Compare March 19, 2023 14:38
Previously, when `pgcopydb` encountered a FATAL error and called
`copydb_fatal_exit`, any wrapper processes around `pgcopydb` would also get
terminated due to the `if (kill(0, SIGTERM) == -1)` statement. To fix this
issue, a new process group is now created for `pgcopydb` during
initialization. This ensures that only the `pgcopydb` process will be
terminated in case of a FATAL error, leaving the wrapper processes intact.
@shubhamdhama shubhamdhama force-pushed the fix-pgcopydb-killing-wrapper branch from f055201 to a8146e8 Compare March 19, 2023 14:39
@dimitri dimitri merged commit de7d5f4 into dimitri:main Mar 20, 2023
@shubhamdhama shubhamdhama deleted the fix-pgcopydb-killing-wrapper branch March 28, 2023 09:16
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.

2 participants
0