lordgamez commented on code in PR #2292:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2292#discussion_r4480990955


##########
minifi_main/MiNiFiMain.cpp:
##########
@@ -289,19 +325,18 @@ int main(int argc, char **argv) {
 
   process_running.test_and_set();
 
-  std::atomic<bool> restart_token{false};
-  const auto request_restart = [&] {
-    if (!restart_token.exchange(true)) {
-      // only trigger if a restart is not already in progress (the flag was 
unset before the exchange)
-      flow_controller_running.clear();
-      flow_controller_running.notify_all();
+  const auto request_shutdown = [&] (minifi::ShutdownType shutdown_type, 
std::optional<int32_t> shutdown_exit_code) {

Review Comment:
   I agree and it crossed my mind too, but this would probably be a bit larger 
refactor due to some of the state being scattered around the MiNiFiMain only 
being captured by the lambda currently, and the tests also use their own 
version of this lambda which would also need a mock implementation of this 
change. Would it be okay to do this in a follow-up jira ticket to have more 
time on this with proper design and testing to avoid any regression?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to