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

postgres:connect process leak #212

Closed
shulcsm opened this issue Oct 2, 2020 · 4 comments
Closed

postgres:connect process leak #212

shulcsm opened this issue Oct 2, 2020 · 4 comments

Comments

@shulcsm
Copy link

shulcsm commented Oct 2, 2020

Description of problem

There seems to be an issue with postgres:connect leaking psql process and subsequently connections.

https://github.com/dokku/dokku-postgres/blob/master/functions#L20
If psql does not return but you terminate / kill ssh connection you are left with unattached psql process.
I'm not familiar with semantics, but shouldn't there be some kind of signal trapping for foreground processes? I suspect this affects other plugins.

@shulcsm
Copy link
Author

shulcsm commented Oct 2, 2020

For the worse killing postgres connections does not solve the issue - processes are still there. I suspect psql does not exit in case of terminated connection because it's run in interactive mode.

@josegonzalez
Copy link
Member

josegonzalez commented Oct 2, 2020

Interesting. That maybe sounds like a bug in psql? Thoughts on how we might fix it/hack around it?

@shulcsm
Copy link
Author

shulcsm commented Oct 5, 2020

I don't think it has anything to do with psql in particular.

  1. If you do something like: shell ssh user@hostdocker exec -it container sleep 60
  2. Kill the ssh
  3. sleep will still be running (including the docker runc / docker-shim). I think it just gets detached.

I'm not sure if TERM is sent or STDIN just gets broken but i think that should be trapped and propagated to exec.
That should probably be done for any interactive dokku / sshcommand call?

I hope this helps. Sorry, i'm way out of my depth here.

@shulcsm
Copy link
Author

shulcsm commented Oct 6, 2020

This seems related moby/moby#9098
Seems like there is not easy / pretty fix.

josegonzalez added a commit to dokku/dokku-couchdb that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-elasticsearch that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-graphite that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-mariadb that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-memcached that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-mongo that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-mysql that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-nats that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-omnisci that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes #212
josegonzalez added a commit to dokku/dokku-pushpin that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-rabbitmq that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-redis that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-rethinkdb that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
josegonzalez added a commit to dokku/dokku-solr that referenced this issue Sep 13, 2021
…for :connect and :enter commands

Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares.

Closes dokku/dokku-postgres#212
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

No branches or pull requests

2 participants