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

Use SIGTERM handling instead of pulling event file for cancel operation #4015

Open
de-jcup opened this issue Mar 26, 2025 · 0 comments
Open
Labels

Comments

@de-jcup
Copy link
Member

de-jcup commented Mar 26, 2025

Situation

Currently the PDS cancel operation is handled by scripts and wrapper application via an event file : events/cancel.json

This means a pulling is necessary.

Also the process termination inside PDS process handling uses java process destroy forcibly (means SIGKILL)

Wanted

  • The event file shall be still written (for debugging purposes)
  • The caller script shall receive a SIGTERM signal
  • Only when SIGTERM does not work (after a configurable timeout) a SIGKILL shall be send

Implementation

  • Destroy the java helper parts for the event checks (means every usage will be shown as errors in code and can be fixed)
    • if it is used in existing wrapper applications, those applications must implement a
      shutdown handler and do cancel operation there
    • if script helper for events exists, those script parts should also be removed
    • existing caller scripts which check for cancel event shall be changed to treat the
      SIGTERM signal instead (for an example look at the existing PDS SIGTERM delegation
      inside the solutions)
  • Directly after writing the event file, the java process (of caller script) must be stopped by
    SIGTERM. For this process.destroy() can be used (see https://hg.openjdk.org/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/native/java/lang/UNIXProcess_md.c#l715) for details
  • The existing implementation which uses process.destroyForcibly() (means SIGKILL)
    shall be kept as is: This will ensure even when a SIGTERM is ignored/not handled,
    after a while the process will 100% be destroyed when still alive
@de-jcup de-jcup added the pds label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant