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

[YSQL] postgres child process of the tablet server does not get terminated automatically when the tablet server gets stopped (macOS) #650

Closed
mbautin opened this issue Dec 10, 2018 · 1 comment
Assignees
Labels
kind/bug This issue is a bug

Comments

@mbautin
Copy link
Collaborator

mbautin commented Dec 10, 2018

@robertpang noticed this a while ago, and @spolitov also ran into this issue recently.

From @robertpang:

BTW, it looks like yb-ctl doesn’t stop the Postgres process when stopping / destroying a cluster (at least for RF1). I remember it used to do so until recently. Could it be due to recent yb-ctl change to support multi-head PG?

23:42 $ ./bin/yb-ctl stop
2018-12-09 23:42:56,275 INFO: Stopping server master-1 PID=74434
2018-12-09 23:42:56,276 INFO: Waiting for server master-1 PID=74434 to stop...
2018-12-09 23:42:56,805 INFO: Stopping server tserver-1 PID=74437
2018-12-09 23:42:56,805 INFO: Waiting for server tserver-1 PID=74437 to stop...
✔ ~/code/yugabyte [master|⚑ 12]
23:42 $ ps
  PID TTY           TIME CMD
 1339 ttys000    0:00.05 /Applications/iTerm.app/Contents/MacOS/iTerm2 --server /usr/bin/login -fpl
 1341 ttys000    0:15.20 -bash
74458 ttys000    0:00.07 /Users/robert/code/yugabyte/build/debug-clang-dynamic-enterprise/postgres/
 1346 ttys001    0:00.05 /Applications/iTerm.app/Contents/MacOS/iTerm2 --server /usr/bin/login -fpl
 1349 ttys001    0:00.58 -bash

Relevant link:

https://stackoverflow.com/questions/284325/how-to-make-child-process-die-after-parent-exits

@mbautin mbautin added the kind/bug This issue is a bug label Dec 10, 2018
@mbautin mbautin self-assigned this Dec 10, 2018
yugabyte-ci pushed a commit that referenced this issue Jan 21, 2019
Summary:
Two independent approaches are being used:
1) postmaster in YB mode at Mac listen when STDIN is closed using same select like it does for sockets. And exit when it happens.
2) When yb-ctl stops tserver it also checks for pg_data/postmaster.pid and tries to kill the appropriate pid.

Test Plan:
bin/yb-ctl create --enable_postgres
make sure that postgres processes are running:
ps -ef | grep postgres
bin/yb-ctl stop
make sure that postgres prcoesses are stopped.

Reviewers: neil, robert, bogdan, mikhail

Reviewed By: robert

Subscribers: ybase, bharat

Differential Revision: https://phabricator.dev.yugabyte.com/D6018
@mbautin
Copy link
Collaborator Author

mbautin commented Jan 28, 2019

Looks like this was solved by 4ad4f5e.
Cc @spolitov just in case.

@mbautin mbautin closed this as completed Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant