xyuanlu commented on code in PR #2550:
URL: https://github.com/apache/helix/pull/2550#discussion_r1248313078
##########
meta-client/src/main/java/org/apache/helix/metaclient/recipes/lock/DistributedSemaphore.java:
##########
@@ -75,9 +76,12 @@ public DistributedSemaphore(MetaClientInterface<DataRecord>
client) {
_metaClient = client;
try {
_metaClient.connect();
- // TODO: Differentiate exception catch between already connected and
already closed.
} catch (IllegalStateException e) {
- // Ignore as it either has already been connected or already been closed.
+ if (e.getMessage().contains("connect() has already been called")) {
+ LOG.info("Client already connected");
Review Comment:
How about we add an API `isClosed` in metaclientInterface. So that we can
use this generic API in recipes client.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]