Skip to content

Commit

Permalink
Merge pull request #6566 from luiseufrasio/FISH-7367-ignore-Replicate…
Browse files Browse the repository at this point in the history
…dMapCantBeCreatedOnLiteMemberException-from-hazelcast

FISH-7362 : Ignore ReplicatedMapCantBeCreatedOnLiteMemberException dispatched from Hazelcast
  • Loading branch information
luiseufrasio authored Feb 19, 2024
2 parents da1b1ad + bf5c28f commit 9f9d126
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright 2024 Payara Foundation and/or affiliates

package org.glassfish.kernel.event;

Expand All @@ -47,6 +48,8 @@
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.hazelcast.replicatedmap.ReplicatedMapCantBeCreatedOnLiteMemberException;
import jakarta.inject.Inject;
import org.glassfish.api.event.EventListener;
import org.glassfish.api.event.EventListener.Event;
Expand Down Expand Up @@ -121,6 +124,7 @@ public void send(final Event event, boolean asynchronously) {
public void run() {
try {
listener.event(event);
} catch(ReplicatedMapCantBeCreatedOnLiteMemberException e) { // Ignore
} catch(Throwable e) {
logger.log(Level.WARNING, KernelLoggerInfo.exceptionDispatchEvent, e);
}
Expand All @@ -133,6 +137,7 @@ public void run() {
// when synchronous listener throws DeploymentException
// we re-throw the exception to abort the deployment
throw de;
} catch(ReplicatedMapCantBeCreatedOnLiteMemberException e) { // Ignore
} catch (Throwable e) {
logger.log(Level.WARNING, KernelLoggerInfo.exceptionDispatchEvent, e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021 Payara Foundation and/or its affiliates. All rights reserved.
* Copyright (c) 2020-2024 Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -153,9 +153,10 @@ public <T extends Number> T getSharedConfiguration(String name, T localValue, Bi
public void clearSharedConfiguration(String name) {
HazelcastInstance hzInstance = hzCore.getInstance();
if (hzInstance != null) { // can be null during shutdown
String instance = instanceName(hzInstance.getCluster().getLocalMember());
Member localMember = hzInstance.getCluster().getLocalMember();
String instance = instanceName(localMember);
String mapName = CONFIGURATION_PREFIX + name;
if (instance != null) {
if (instance != null && !localMember.isLiteMember()) {
hzInstance.getReplicatedMap(mapName).remove(instance);
}
}
Expand Down

0 comments on commit 9f9d126

Please sign in to comment.