Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-7362 : Ignore ReplicatedMapCantBeCreatedOnLiteMemberException dispatched from Hazelcast #6566

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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