Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Terminating a MarkLogic processor results in ghost flow files #97

Open
dmcassel opened this issue Jan 21, 2021 · 2 comments
Open

Terminating a MarkLogic processor results in ghost flow files #97

dmcassel opened this issue Jan 21, 2021 · 2 comments

Comments

@dmcassel
Copy link
Contributor

There are times when I've had to terminate a MarkLogic processor (definitely PutMarkLogic and I believe ExecuteScriptMarkLogic as well). This happens when I've told the processor to Stop, but it doesn't. Any flow files that the processor has pulled from the upstream queue but not yet routed somewhere become ghost flow files. That is, they will be included in the count in the upstream queue, but otherwise NiFi does not acknowledge them. They won't show up when looking at the list of flow files in the queue and emptying the queue won't affect them. The only way to remedy this situation is to restart NiFi.

I'm not sure what happens in a processor when it gets sent a terminate signal, so I'm unsure about the solution to this. It's a little tricky to reproduce. Filing in the hopes that others can add more detail.

@rjrudin
Copy link
Contributor

rjrudin commented Jan 23, 2021

Based on ticket 91 in marklogic/nifi, my understanding is that an FF gets "stuck" in a queue at least in the scenario where a call is made to session.commit() without first setting a destination relationship on the incoming FF.

FF's don't get a relationship in PutML until onBatchSuccess or onBatchFailure is called by WriteBatcher. I don't know what NiFi does when a user stops a processor that is processing FFs. I'm guessing that the session perhaps becomes invalid, such that PutML isn't able to transfer the incoming FFs to a destination, and thus they become stuck.

@rjrudin
Copy link
Contributor

rjrudin commented Jan 23, 2021

PutML does have a completeWriteBatcherJob method with annotations of OnStopped and OnShutdown, which will flush the WriteBatcher, which then leads to onBatchSuccess being called. But still, not clear what the state of the NiFi session is at that point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants