Currently, if the runner application exits either normally (e.g. runner auto updates) or due to an error (e.g., exit code 1), the runner is not deregistered automatically.
In my docker compose file, I have set restart: always to try to keep runners available, but if the runner process exits and then the container is restarted, a new runner instance is registered and the old instance is orphaned. Our runner was continuously exiting due to errors at launch, and we ended up registering 10,000 runner instances, hitting the limit of allowed runner instances.
From what I can tell, this seems to happen because the deregister trap set up in entrypoint.sh only catches external signals to kill the runner like SIGTERM or SIGINT, but the runner exiting by itself isn't covered.
I think if we add EXIT to the list of signals to catch, that should allow deregistration to happen when the runner process exits by itself:
trap_with_arg deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT EXIT
Currently, if the runner application exits either normally (e.g. runner auto updates) or due to an error (e.g., exit code 1), the runner is not deregistered automatically.
In my docker compose file, I have set
restart: alwaysto try to keep runners available, but if the runner process exits and then the container is restarted, a new runner instance is registered and the old instance is orphaned. Our runner was continuously exiting due to errors at launch, and we ended up registering 10,000 runner instances, hitting the limit of allowed runner instances.From what I can tell, this seems to happen because the deregister trap set up in
entrypoint.shonly catches external signals to kill the runner likeSIGTERMorSIGINT, but the runner exiting by itself isn't covered.I think if we add EXIT to the list of signals to catch, that should allow deregistration to happen when the runner process exits by itself: