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

[EJBCLIENT-531] Discovery: take static blocklist into account during cluster discovery #680

Merged
merged 1 commit into from
Jan 19, 2024
Merged
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 @@ -256,6 +256,10 @@ static void setupSessionAffinities(EJBSessionCreationInvocationContext context)
private void processMissingTarget(final AbstractInvocationContext context, final Exception cause) {
final URI destination = context.getDestination();

if (Logs.INVOCATION.isDebugEnabled()) {
Logs.INVOCATION.debugf(cause, "DiscoveryEJBClientInterceptor: invocation failed with the following exception");
}

if (destination == null || context.getTargetAffinity() == Affinity.LOCAL) {
// nothing we can/should do.
return;
Expand Down Expand Up @@ -631,13 +635,12 @@ private List<Throwable> doClusterDiscovery(AbstractInvocationContext context, fi
Map<String, URI> nodes = new HashMap<>();
final EJBClientContext clientContext = context.getClientContext();
final List<Throwable> problems;
final Set<URI> blocklist = getBlocklist();
long timeout = DISCOVERY_TIMEOUT * 1000;
try (final ServicesQueue queue = discover(context, filterSpec)) {
ServiceURL serviceURL;
while ((serviceURL = queue.takeService(timeout, TimeUnit.MILLISECONDS)) != null) {
final URI location = serviceURL.getLocationURI();
if (!blocklist.contains(location)) {
if (!isBlocklisted(context, location)) {
final EJBReceiver transportProvider = clientContext.getTransportProvider(location.getScheme());
if (transportProvider != null && satisfiesSourceAddress(serviceURL, transportProvider)) {
final AttributeValue nodeNameValue = serviceURL.getFirstAttributeValue(FILTER_ATTR_NODE);
Expand Down
Loading