Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-7314

HandleHttpRequest should stop Jetty in OnUnscheduled instead of OnStopped

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.12.0
    • Extensions
    • None

    Description

      Jetty server is being stopped in OnStopped currently.
      OnStopped runs only after the ongoing onTigger() calls have finished, but if the onTrigger() thread hangs up for some reason, OnStopped will never be called and Jetty won't be stopped (which would probably cease the hang-up in onTrigger).

      To avoid this possible hang-up: move the stopping logic from OnStopped to OnUnschedule which runs just after the user clicks Stop.

      Graceful shutdown could also be implemented: at the beginning of OnUnschedule wait for ongoing request to be finished for a while (with some timeout to avoid hang-up here). Also reject new requests in this period with HTTP 503 + "Server shutting down" response.

      Attachments

        Issue Links

          Activity

            People

              tpalfy Tamas Palfy
              turcsanyip Peter Turcsanyi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h