Skip to content

Commit

Permalink
Merge pull request #680 from ivassile/JBEAP-26389
Browse files Browse the repository at this point in the history
[EJBCLIENT-531] Discovery: take static blocklist into account during cluster discovery
  • Loading branch information
tadamski authored Jan 19, 2024
2 parents f7305e3 + 8a19dd6 commit a704271
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit a704271

Please sign in to comment.