poorbarcode commented on code in PR #25915:
URL: https://github.com/apache/pulsar/pull/25915#discussion_r3347168087


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -741,6 +741,10 @@ protected void startInactivityMonitor() {
             int interval = 
pulsar().getConfiguration().getBrokerDeleteInactiveTopicsFrequencySeconds();
             inactivityMonitor.scheduleAtFixedRateNonConcurrently(() -> 
checkGC(), interval, interval,
                     TimeUnit.SECONDS);
+            if 
(pulsar().getConfig().getBrokerReplicationInactiveThresholdSeconds() > 0) {

Review Comment:
   > brokerReplicationInactiveThresholdSeconds is type of Integer in 
ServiceConfiguration. Technically it can be set to null. Therefore a null check 
could be useful.
   
   Changed the type to `int`
   
   > Another detail is that the field has dynamic = true. The scheduled task 
wouldn't get cancelled and rescheduled with the updated value. Again, setting 
to dynamic = false would be a way to address this without adding support for 
dynamic configuration of brokerReplicationInactiveThresholdSeconds.
   
   The scheduled interval depends on another configuration 
`brokerDeleteInactiveTopicsFrequencySeconds`, Once the value of 
`brokerReplicationInactiveThresholdSeconds`, the behavior will change, the test 
`testDisconnectAndReconnectInactiveReplicator` proved the behavior



-- 
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