Copilot commented on code in PR #14700:
URL: https://github.com/apache/cloudstack/pull/14700#discussion_r4575845520


##########
core/src/main/java/com/cloud/network/HAProxyConfigurator.java:
##########
@@ -648,6 +653,8 @@ public String[] generateConfiguration(final 
LoadBalancerConfigCommand lbCmd) {
             // default HAProxy timeout values from defaultsSection for 
predictability.
             logger.warn("Negative idleTimeout ({}) configured; retaining 
default HAProxy timeouts.", lbCmd.idleTimeout);
         }
+        dSection.set(11, "\ttimeout client-fin " + Long.toString(finTimeout));
+        dSection.set(12, "\ttimeout server-fin " + Long.toString(finTimeout));

Review Comment:
   These writes mutate the shared static `defaultsSection` array because 
`dSection` is an `Arrays.asList` view, not a copy. Configurations for different 
routers can run concurrently (`VirtualRoutingResource.executeRequest()` locks 
per router), so another call can overwrite the FIN directives before 
`result.addAll(dSection)`, making a command requesting 1234 ms emit 50000 ms 
instead. Make a per-call copy of the defaults array before applying 
command-specific values.



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