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

ConsumeWindowsEventLog leads to a stackoverflow when subscription fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.11.0
    • Component/s: Extensions
    • Labels:
      None

      Description

       

      The ConsumeWindowsEvenLog processor causes a stack overflow when it fails to subscribe to a log.
      Sadly I cannot provide logs (working under an NDA).

      Since I cannot provide logs I will try to describe the flow:
      1. isSubscribed function is called and the subscription fails (line 242)
      2. isSubscribed calls unsubscribe function (line 250)
      3. unsubscribe function calls isSubscribed (line 290)
      4. repeat

       

      The second line causes the issue:

       

      private boolean isSubscribed() {
          final boolean subscribed = subscriptionHandle != null && subscriptionHandle.getPointer() != null;
          final boolean subscriptionFailed = evtSubscribeCallback != null
              && ((EventSubscribeXmlRenderingCallback) evtSubscribeCallback).isSubscriptionFailed();
          final boolean subscribing = subscribed && !subscriptionFailed;
          getLogger().debug("subscribing? {}, subscribed={}, subscriptionFailed={}", new Object[]{subscribing, subscribed, subscriptionFailed});
          if (subscriptionFailed) {
              getLogger().info("Canceling a failed subscription.");
              unsubscribe();
          }
          return subscribing;
      }

      If evtSubscribeCallback is null we're stuck in a stackoverflow, the isSubscriptionFailed function in EventSubscribeXmlRenderingCallback returns a boolean called subscriptionFailed which is private and set to true when it fails to subscribe, nowhere in the class is it set back to false.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                momoadc Momo Adc
              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 20m
                  20m