szaszm commented on a change in pull request #1025:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1025#discussion_r591433099
##########
File path: libminifi/include/core/ProcessorConfig.h
##########
@@ -35,10 +35,8 @@ namespace core {
#define DEFAULT_SCHEDULING_PERIOD_MILLIS 1000
#define DEFAULT_RUN_DURATION 0
#define DEFAULT_MAX_CONCURRENT_TASKS 1
-#define DEFAULT_PENALIZATION_PERIOD 1
-// Default yield period in second
#define DEFAULT_YIELD_PERIOD_SECONDS 1
-#define DEFAULT_PENALIZATION_PERIOD_SECONDS 30
+constexpr std::chrono::seconds DEFAULT_PENALIZATION_PERIOD{30};
Review comment:
With exponential backoff now implemented, I think it would make sense to
reduce the default penalty. I would go for 5 sec. With a max multiplier of
1000, this would mean a max penalty of more than an hour, which is plenty IMO.
##########
File path: libminifi/include/core/state/nodes/SchedulingNodes.h
##########
@@ -85,7 +85,7 @@ class SchedulingDefaults : public DeviceInformation {
SerializedResponseNode penalizationPeriod;
penalizationPeriod.name = "penalizationPeriodMillis";
- penalizationPeriod.value = DEFAULT_PENALIZATION_PERIOD_SECONDS*1000;
+ penalizationPeriod.value =
std::chrono::duration_cast<std::chrono::milliseconds>(core::DEFAULT_PENALIZATION_PERIOD).count();
Review comment:
Instead of duration cast, we can use the duration constructor for
lossless conversion.
```suggestion
penalizationPeriod.value =
std::chrono::milliseconds{core::DEFAULT_PENALIZATION_PERIOD}.count();
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]