lhotari commented on a change in pull request #10199:
URL: https://github.com/apache/pulsar/pull/10199#discussion_r612555706



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -308,10 +310,17 @@ public void close() throws PulsarServerException {
         try {
             closeAsync().get();
         } catch (ExecutionException e) {
-            if (e.getCause() instanceof PulsarServerException) {
-                throw (PulsarServerException) e.getCause();
+            Throwable cause = e.getCause();
+            if (cause instanceof PulsarServerException) {
+                throw (PulsarServerException) cause;
+            } else if (cause instanceof TimeoutException) {
+                if (getConfiguration().getBrokerShutdownTimeoutMs() < 1000L) {
+                    // ignore shutdown timeout when it's less than 1000ms (in 
tests)

Review comment:
       The reason to do this choice is to simplify the configuration for tests. 
This PR sets the brokerShutdownTimeMs to 100 ms in tests. If the timeout 
exception wouldn't be ignored, special handling would be needed in all tests to 
catch the TimeoutException and ignore it. I'm expecting that it's a justified 
tradeoff to have different behavior if the user goes and configured shutdown 
timeout to less than 1000 ms. WDYT?




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


Reply via email to