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

Provide ability to add signals that may stop the job. #900

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mohitnatoo
Copy link

  • Converted raise_signal_exceptions class attribute accessor to raise_exceptions_for_signals.
  • This, by default will be a blank array that is similar to having raise_signal_exceptions = false.
  • Since there is a specific check for :term signal, change has been made to raise exception if raise_exceptions_for_signals array has the signal code.
  • Also, currently only INT and TERM signals are considered. Added change to provide ability of adding more signals (like 'QUIT'), whose receipt can end the job.
  • Made sure that we have INT and TERM signals always considered.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 91.324% when pulling 67c1e53 on mohitnatoo:812-signal-handling into 401f43e on collectiveidea:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 91.324% when pulling 910e5bd on mohitnatoo:812-signal-handling into 401f43e on collectiveidea:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 91.324% when pulling c4b52ae on mohitnatoo:812-signal-handling into 401f43e on collectiveidea:master.

@johha
Copy link

johha commented Feb 7, 2023

@albus522 Any chance to merge this? Would be very helpful for as we'd like to react on QUIT signals.

johha added a commit to sap-contributions/cloud_controller_ng that referenced this pull request Feb 13, 2023
Adds a monkey patches to delayed_job workers to gracefully shutdown in case of a `QUIT` signal.
So far delayed_job only considered `INT` & `TERM` signals for graceful shutdown.
This might become obsolete once the following change is merged into delayed_job.
See collectiveidea/delayed_job#900

To ensure that a version bump of delayed_job does not break the monkey patch
a test will fail in case the version number changes.
In case of a version bump it needs to be manually verified if the monkey
patch still works.

Co-authored-by: Philipp Thun <[email protected]>
Co-authored-by: Sven Krieger <[email protected]>
Co-authored-by: Johannes Haass <[email protected]>
johha added a commit to sap-contributions/cloud_controller_ng that referenced this pull request Feb 13, 2023
Adds a monkey patches to delayed_job workers to gracefully shutdown in case of a `QUIT` signal.
So far delayed_job only considered `INT` & `TERM` signals for graceful shutdown.
This might become obsolete once the following change is merged into delayed_job.
See collectiveidea/delayed_job#900

To ensure that a version bump of delayed_job does not break the monkey patch
a test will fail in case the version number changes.
In case of a version bump it needs to be manually verified if the monkey
patch still works.

Co-authored-by: Philipp Thun <[email protected]>
Co-authored-by: Sven Krieger <[email protected]>
Co-authored-by: Johannes Haass <[email protected]>
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

3 participants