Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64359

Call shutdown handlers on SIGINT/SIGTERM

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 3.7
    • 3.7
    • General

      Ctrl+C generates a SIGINT, but we do not make any attempt to handle that. Same goes for a SIGTERM.
      These should cause the shutdown handlers to be called as in normal operation.

      Whilst we can't do so on windows (pcntl doesn't exist there) we can on *nix systems using the pcntl extension (optional but most OSs compile with it).

      The patch I have produced makes use of pcntl_async_signals which is only available from PHP 7.1. Prior to this you had to use ticks which had an effect on performance. Moodle 3.7 will not support PHP 7.0 as it is no longer in official support in any way (security support ended last week) so this is fine.

      I noticed this as we do not clean up locks, or per-request directories if the user manually cancelled the request (i.e. cron).

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Carlos Escobedo Carlos Escobedo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.