[ 
https://issues.apache.org/jira/browse/NIFI-6996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17018957#comment-17018957
 ] 

ASF subversion and git services commented on NIFI-6996:
-------------------------------------------------------

Commit 4fec54debfdf8face33cb1738a0d2b340e249f09 in nifi's branch 
refs/heads/master from Gal Shinder
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=4fec54d ]

NIFI-6996 This closes #3981. Fixed a stackoverflow that occurs when a 
subscription fails.

Signed-off-by: Joe Witt <[email protected]>


> ConsumeWindowsEventLog leads to a stackoverflow when subscription fails
> -----------------------------------------------------------------------
>
>                 Key: NIFI-6996
>                 URL: https://issues.apache.org/jira/browse/NIFI-6996
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.10.0
>            Reporter: Momo Adc
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
>  
> 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:
>  
> {code:java}
> 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;
> }{code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to