Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pots left behind in case job is dying #19

Closed
grembo opened this issue Feb 15, 2020 · 8 comments
Closed

pots left behind in case job is dying #19

grembo opened this issue Feb 15, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@grembo
Copy link
Contributor

grembo commented Feb 15, 2020

In case the process of a pot dies (e.g. killall nginx) the task is restarted automatically by nomad as expected, but the pot is left behind (pot list). When doing a graceful stop of a job (nomad stop job) this isn't the case.

@pizzamig
Copy link
Contributor

There is already a workaround for this, even if not fully documented.
The pots left behind can be automatically destroyed via pot prune. nomad launched pot are marked as prunable, meaning that, once stopped, they can be removed.
In minipot there is a cronjob to run pot prune periodically

@grembo
Copy link
Contributor Author

grembo commented Feb 15, 2020

There is already a workaround for this, even if not fully documented.
The pots left behind can be automatically destroyed via pot prune. nomad launched pot are marked as prunable, meaning that, once stopped, they can be removed.
In minipot there is a cronjob to run pot prune periodically

Is the pot marked prunable before or after launch? I'm wondering if there is a possibility for bad timing leading to accidental destruction of a pot that is in the middle of getting provisioned if pot prune is run from cron.

@pizzamig
Copy link
Contributor

The mechanism is implemented in 2 steps to avoid the situation you described.
There are 2 attributes: prunable and to-be-pruned.
The attribute prunable can be set by the user and automatically set by pot prepare (this command has been designed to interact with nomad).
The attribute to-be-pruned is set by pot start if prunable is true.
pot prune will remove pots that are not running and that have the attribute prunableand to-be-pruned set to true.

@grembo
Copy link
Contributor Author

grembo commented Feb 20, 2020

It might make sense to integrate this feature into the pot driver (maybe configurable?).

@pizzamig
Copy link
Contributor

There is a garbage collection feature in nomad and the idea is to run pot prune in that moment.
It's currently not working and we need to investigate the cause.
An alternative idea is to run pot prune after the pot is stopped.

@pizzamig pizzamig added the enhancement New feature or request label Feb 21, 2020
@grembo
Copy link
Contributor Author

grembo commented Jan 31, 2022

@pizzamig I think the changes in bsdpot/pot#200 and #30 might actually solve this one as well.

@einsiedlerkrebs
Copy link
Contributor

einsiedlerkrebs commented Mar 22, 2023

comment moved to #35 (as new issue)

@grembo
Copy link
Contributor Author

grembo commented Jun 27, 2023

I think this has been overcome by events

@grembo grembo closed this as completed Jun 27, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants