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

Setup "pgid" for server running in foreground mode #575

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kradima
Copy link

@kradima kradima commented Nov 14, 2018

It's expected that pgid to be setup for "foreground" running server rather than for "background".

So it should be changed to set_pgid if foreground?

See discussion e16e085#r18804964

… rather than for "background".

So it should be changed to `set_pgid if foreground?`

See discussion [here](rails@e16e085#r18804964)
@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @grosser (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@grosser
Copy link
Collaborator

grosser commented Nov 14, 2018

@jonleighton @develop7 @hjwylde plz review

grosser referenced this pull request Nov 14, 2018
This command to start a Spring server explicitly in the foreground,
which logging to stdout.

This will be useful to those who want to run spring more explicitly, but
the real impetus was to enable running a spring server inside a Docker
container.
@hjwylde
Copy link

hjwylde commented Nov 15, 2018

LGTM

Copy link

@develop7 develop7 left a comment

Choose a reason for hiding this comment

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

Looks good

@develop7
Copy link

:shipit:

@jonleighton
Copy link
Member

My memory of the spring code is not super fresh, but I think the code is correct as-is and this should not be merged.

The idea of the set_pgid method is that it ties the background spring process to the current terminal session. Therefore, when the terminal session ends, the background process also gets killed.

So I think merging this will result in orphaned spring processes accumulating on users' machines.

When running in 'foreground mode', the spring process is never detached. Therefore it will just be up to the parent process to kill it when necessary.

If people want to run spring outside of a terminal session, they should do so using spring server, then they can manage the starting/stopping manually as desired.

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.

None yet

6 participants