You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "fgerlits (via GitHub)" <gi...@apache.org> on 2025/12/03 14:19:30 UTC

[PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

fgerlits opened a new pull request, #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079

   documentation update only
   
   https://issues.apache.org/jira/browse/MINIFICPP-2694
   
   ---
   
   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [x] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [x] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm closed pull request #2079: MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "fgerlits (via GitHub)" <gi...@apache.org>.
fgerlits commented on code in PR #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079#discussion_r2588260585


##########
CONFIGURE.md:
##########
@@ -454,19 +454,28 @@ If a processor is triggered but has no work available, it will yield for the con
     # in minifi.properties
     nifi.bored.yield.duration=100 millis
 
-### Graceful shutdown period
+### FlowController drain timeout
 
-It is possible to configure a graceful shutdown period, the period the flow controller will wait to unload the flow configuration and stop running processors.
+When the flow is stopped, either because of a flow update from C2, a restart command from C2, or because MiNiFi is stopped by the operating system,
+MiNiFi stops all source processors (processors without incoming connections) first. Next, it waits for all connection queues to become empty, but
+at most the amount of time set in the
 
     # in minifi.properties
-    nifi.flowcontroller.graceful.shutdown.period=30 sec
+    nifi.flowcontroller.drain.timeout=5 sec
 
-### FlowController drain timeout
+property. The default value is zero, i.e., no wait. Finally, it shuts down the remaining processors. If there are flow files left in some connection
+queues after the drain timeout, they will be discarded.
 
-Timeout period for finishing processing of flow files in progress when shutting down flow controller. When not set we do not wait for flow files to finish processing.
+### Graceful shutdown period
+
+When MiNiFi is stopped or restarted, either because of a restart command from C2, or because MiNiFi is stopped by the operating system,
+it may wait for connection queues to become empty if `nifi.flowcontroller.drain.timeout` is set in `minifi.properties`. You can limit this wait
+to a shorter time by setting the
 
     # in minifi.properties
-    nifi.flowcontroller.drain.timeout=500 millis
+    nifi.flowcontroller.graceful.shutdown.period=2 sec
+
+property. By default, the graceful shutdown period property is not set, which means the wait is only limited by the drain timeout property.

Review Comment:
   Done: 67793e24d57cf17cb7d0a610fb0bd8dae9a8b032, f3afeb9ddd221364448af99d8fb45a116bc69e6f.
   
   I have also updated the default value of `graceful.shutdown.period`, which was wrong: it is 30 seconds, not zero.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "fgerlits (via GitHub)" <gi...@apache.org>.
fgerlits commented on code in PR #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079#discussion_r2598754070


##########
CONFIGURE.md:
##########
@@ -454,19 +454,25 @@ If a processor is triggered but has no work available, it will yield for the con
     # in minifi.properties
     nifi.bored.yield.duration=100 millis
 
-### Graceful shutdown period
+### FlowController drain timeout and graceful shutdown period
 
-It is possible to configure a graceful shutdown period, the period the flow controller will wait to unload the flow configuration and stop running processors.
+When the flow is stopped, either because of a flow update from C2, a stop or restart command from C2, or because MiNiFi is stopped by the operating system,
+MiNiFi stops all source processors (processors without incoming connections) first. Next, it waits for all connection queues to become empty, but
+at most the amount of time set in the
 
     # in minifi.properties
-    nifi.flowcontroller.graceful.shutdown.period=30 sec
+    nifi.flowcontroller.drain.timeout=5 sec
 
-### FlowController drain timeout
+property. The default value is zero, i.e., no wait. Finally, it shuts down the remaining processors. If there are flow files left in some connection
+queues after the drain timeout, they will be discarded.

Review Comment:
   thanks -- I've applied the suggestion



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079#discussion_r2586220622


##########
CONFIGURE.md:
##########
@@ -454,19 +454,28 @@ If a processor is triggered but has no work available, it will yield for the con
     # in minifi.properties
     nifi.bored.yield.duration=100 millis
 
-### Graceful shutdown period
+### FlowController drain timeout
 
-It is possible to configure a graceful shutdown period, the period the flow controller will wait to unload the flow configuration and stop running processors.
+When the flow is stopped, either because of a flow update from C2, a restart command from C2, or because MiNiFi is stopped by the operating system,
+MiNiFi stops all source processors (processors without incoming connections) first. Next, it waits for all connection queues to become empty, but
+at most the amount of time set in the
 
     # in minifi.properties
-    nifi.flowcontroller.graceful.shutdown.period=30 sec
+    nifi.flowcontroller.drain.timeout=5 sec
 
-### FlowController drain timeout
+property. The default value is zero, i.e., no wait. Finally, it shuts down the remaining processors. If there are flow files left in some connection
+queues after the drain timeout, they will be discarded.
 
-Timeout period for finishing processing of flow files in progress when shutting down flow controller. When not set we do not wait for flow files to finish processing.
+### Graceful shutdown period
+
+When MiNiFi is stopped or restarted, either because of a restart command from C2, or because MiNiFi is stopped by the operating system,
+it may wait for connection queues to become empty if `nifi.flowcontroller.drain.timeout` is set in `minifi.properties`. You can limit this wait
+to a shorter time by setting the
 
     # in minifi.properties
-    nifi.flowcontroller.drain.timeout=500 millis
+    nifi.flowcontroller.graceful.shutdown.period=2 sec
+
+property. By default, the graceful shutdown period property is not set, which means the wait is only limited by the drain timeout property.

Review Comment:
   I think it would be nice to document even uncommon use cases. Since the two properties act similarly, maybe it would make more sense to document them in a single section, and document the differences. What do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "fgerlits (via GitHub)" <gi...@apache.org>.
fgerlits commented on code in PR #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079#discussion_r2585810849


##########
CONFIGURE.md:
##########
@@ -454,19 +454,28 @@ If a processor is triggered but has no work available, it will yield for the con
     # in minifi.properties
     nifi.bored.yield.duration=100 millis
 
-### Graceful shutdown period
+### FlowController drain timeout
 
-It is possible to configure a graceful shutdown period, the period the flow controller will wait to unload the flow configuration and stop running processors.
+When the flow is stopped, either because of a flow update from C2, a restart command from C2, or because MiNiFi is stopped by the operating system,
+MiNiFi stops all source processors (processors without incoming connections) first. Next, it waits for all connection queues to become empty, but
+at most the amount of time set in the
 
     # in minifi.properties
-    nifi.flowcontroller.graceful.shutdown.period=30 sec
+    nifi.flowcontroller.drain.timeout=5 sec
 
-### FlowController drain timeout
+property. The default value is zero, i.e., no wait. Finally, it shuts down the remaining processors. If there are flow files left in some connection
+queues after the drain timeout, they will be discarded.
 
-Timeout period for finishing processing of flow files in progress when shutting down flow controller. When not set we do not wait for flow files to finish processing.
+### Graceful shutdown period
+
+When MiNiFi is stopped or restarted, either because of a restart command from C2, or because MiNiFi is stopped by the operating system,
+it may wait for connection queues to become empty if `nifi.flowcontroller.drain.timeout` is set in `minifi.properties`. You can limit this wait
+to a shorter time by setting the
 
     # in minifi.properties
-    nifi.flowcontroller.drain.timeout=500 millis
+    nifi.flowcontroller.graceful.shutdown.period=2 sec
+
+property. By default, the graceful shutdown period property is not set, which means the wait is only limited by the drain timeout property.

Review Comment:
   I think it's the minimum of these two (plus some overhead, which is negligible) in all cases, including a C2 STOP, except for a flow update. For flow updates, only drain.timeout applies, graceful.shutdown.period doesn't.
   
   I did not include C2 STOP in the list of examples, because I don't think that is a common use case, unlike flow update, C2 RESTART and termination by the OS.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079#discussion_r2585326934


##########
CONFIGURE.md:
##########
@@ -454,19 +454,28 @@ If a processor is triggered but has no work available, it will yield for the con
     # in minifi.properties
     nifi.bored.yield.duration=100 millis
 
-### Graceful shutdown period
+### FlowController drain timeout
 
-It is possible to configure a graceful shutdown period, the period the flow controller will wait to unload the flow configuration and stop running processors.
+When the flow is stopped, either because of a flow update from C2, a restart command from C2, or because MiNiFi is stopped by the operating system,
+MiNiFi stops all source processors (processors without incoming connections) first. Next, it waits for all connection queues to become empty, but
+at most the amount of time set in the
 
     # in minifi.properties
-    nifi.flowcontroller.graceful.shutdown.period=30 sec
+    nifi.flowcontroller.drain.timeout=5 sec
 
-### FlowController drain timeout
+property. The default value is zero, i.e., no wait. Finally, it shuts down the remaining processors. If there are flow files left in some connection
+queues after the drain timeout, they will be discarded.
 
-Timeout period for finishing processing of flow files in progress when shutting down flow controller. When not set we do not wait for flow files to finish processing.
+### Graceful shutdown period
+
+When MiNiFi is stopped or restarted, either because of a restart command from C2, or because MiNiFi is stopped by the operating system,
+it may wait for connection queues to become empty if `nifi.flowcontroller.drain.timeout` is set in `minifi.properties`. You can limit this wait
+to a shorter time by setting the
 
     # in minifi.properties
-    nifi.flowcontroller.drain.timeout=500 millis
+    nifi.flowcontroller.graceful.shutdown.period=2 sec
+
+property. By default, the graceful shutdown period property is not set, which means the wait is only limited by the drain timeout property.

Review Comment:
   Does this mean the effective limit is the minimum of the drain timeout and the graceful shutdown period when it's not a C2 STOP command?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079#discussion_r2598673519


##########
CONFIGURE.md:
##########
@@ -454,19 +454,25 @@ If a processor is triggered but has no work available, it will yield for the con
     # in minifi.properties
     nifi.bored.yield.duration=100 millis
 
-### Graceful shutdown period
+### FlowController drain timeout and graceful shutdown period
 
-It is possible to configure a graceful shutdown period, the period the flow controller will wait to unload the flow configuration and stop running processors.
+When the flow is stopped, either because of a flow update from C2, a stop or restart command from C2, or because MiNiFi is stopped by the operating system,
+MiNiFi stops all source processors (processors without incoming connections) first. Next, it waits for all connection queues to become empty, but
+at most the amount of time set in the
 
     # in minifi.properties
-    nifi.flowcontroller.graceful.shutdown.period=30 sec
+    nifi.flowcontroller.drain.timeout=5 sec
 
-### FlowController drain timeout
+property. The default value is zero, i.e., no wait. Finally, it shuts down the remaining processors. If there are flow files left in some connection
+queues after the drain timeout, they will be discarded.

Review Comment:
   This is not quite correct if I understand it right. I'd clarify to avoid giving users a heart attack. :sweat_smile: 
   ```suggestion
   queues after the drain timeout, they will remain saved to disk (when using persistent repositories, which is the default) or be discarded (when using volatile repositories).
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2694 Clarify the documentation of drain.timeout and graceful.shutdown.period [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #2079:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2079#discussion_r2598673519


##########
CONFIGURE.md:
##########
@@ -454,19 +454,25 @@ If a processor is triggered but has no work available, it will yield for the con
     # in minifi.properties
     nifi.bored.yield.duration=100 millis
 
-### Graceful shutdown period
+### FlowController drain timeout and graceful shutdown period
 
-It is possible to configure a graceful shutdown period, the period the flow controller will wait to unload the flow configuration and stop running processors.
+When the flow is stopped, either because of a flow update from C2, a stop or restart command from C2, or because MiNiFi is stopped by the operating system,
+MiNiFi stops all source processors (processors without incoming connections) first. Next, it waits for all connection queues to become empty, but
+at most the amount of time set in the
 
     # in minifi.properties
-    nifi.flowcontroller.graceful.shutdown.period=30 sec
+    nifi.flowcontroller.drain.timeout=5 sec
 
-### FlowController drain timeout
+property. The default value is zero, i.e., no wait. Finally, it shuts down the remaining processors. If there are flow files left in some connection
+queues after the drain timeout, they will be discarded.

Review Comment:
   This is not quite correct if I understand it right. I'd clarify to avoid giving users a heart attack by making them think they lose data. :sweat_smile: 
   ```suggestion
   queues after the drain timeout, they will remain saved to disk (when using persistent repositories, which is the default) or be discarded (when using volatile repositories).
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org