mirror of https://github.com/apache/nifi.git
NIFI-6996 This closes #3981. Fixed a stackoverflow that occurs when a subscription fails.
Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
parent
b35ad7cd20
commit
4fec54debf
|
@ -239,8 +239,12 @@ public class ConsumeWindowsEventLog extends AbstractSessionFactoryProcessor {
|
|||
return null;
|
||||
}
|
||||
|
||||
private boolean isSubscriptionHandleOpen(){
|
||||
return subscriptionHandle != null && subscriptionHandle.getPointer() != null;
|
||||
}
|
||||
|
||||
private boolean isSubscribed() {
|
||||
final boolean subscribed = subscriptionHandle != null && subscriptionHandle.getPointer() != null;
|
||||
final boolean subscribed = isSubscriptionHandleOpen();
|
||||
final boolean subscriptionFailed = evtSubscribeCallback != null
|
||||
&& ((EventSubscribeXmlRenderingCallback) evtSubscribeCallback).isSubscriptionFailed();
|
||||
final boolean subscribing = subscribed && !subscriptionFailed;
|
||||
|
@ -287,7 +291,7 @@ public class ConsumeWindowsEventLog extends AbstractSessionFactoryProcessor {
|
|||
}
|
||||
|
||||
private void unsubscribe() {
|
||||
if (isSubscribed()) {
|
||||
if (isSubscriptionHandleOpen()) {
|
||||
wEvtApi.EvtClose(subscriptionHandle);
|
||||
}
|
||||
subscriptionHandle = null;
|
||||
|
|
Loading…
Reference in New Issue