-
Bug
-
Resolution: Done
-
Major
-
7.3.z.GA
-
False
-
False
-
-
-
-
-
-
+
-
Undefined
-
JBEAP-18565 / EJBCLIENT-361 , the blacklist timeout check is backwards in the getBlacklist method. The isBlackListed is correct, it removes from the blacklist if delta > BLACKLIST_TIMEOUT , whereas getBlacklist is removing if delta < BLACKLIST_TIMEOUT.
This bug causes destinations that get blacklisted to be removed from the blacklist before the timeout resulting in those requests having to be retried on another node. It also could result in a backlisted destination from not being added back into the available destinations if one gets blacklisted and the next time it is checked that the blacklist timeout has passed, that destination would then never be removed from the blacklist.
74 public final class DiscoveryEJBClientInterceptor implements EJBClientInterceptor { 91 private static final long BLACKLIST_TIMEOUT = 92 AccessController.doPrivileged((PrivilegedAction<Long>) () -> { 93 String val = System.getProperty("org.jboss.ejb.client.discovery.blacklist.timeout"); 94 try { 95 return TimeUnit.MILLISECONDS.toNanos(Long.valueOf(val)); 96 } catch (NumberFormatException e) { 97 return TimeUnit.MILLISECONDS.toNanos(5000L); 98 } 99 }); 311 static boolean isBlackListed(AbstractInvocationContext context, URI destination) { 312 final Set<URI> invocationBlacklist = context.getAttachment(BL_KEY); 313 if (invocationBlacklist != null && invocationBlacklist.contains(destination)) { 314 return true; 315 } 316 if (!blacklist.containsKey(destination)) { 317 return false; 318 } 319 final long blacklistedTimestamp = blacklist.get(destination); 320 final long delta = System.nanoTime() - blacklistedTimestamp; 321 if (delta < BLACKLIST_TIMEOUT) { 322 return true; 323 } else { 324 blacklist.remove(destination); 325 return false; 326 } 327 } 328 329 private static Set<URI> getBlacklist(){ 330 blacklist.entrySet().removeIf(e -> 331 { 332 final long delta = System.nanoTime() - e.getValue(); 333 return delta < BLACKLIST_TIMEOUT; 334 }); 335 return blacklist.keySet(); 336 }
- clones
-
EJBCLIENT-386 DiscoveryEJBClientInterceptor.getBlacklist check is incorrect
- Resolved
- incorporates
-
EJBCLIENT-386 DiscoveryEJBClientInterceptor.getBlacklist check is incorrect
- Resolved
- is incorporated by
-
JBEAP-19790 [GSS](7.3.z) Upgrade jboss-ejb-client from 4.0.33.SP1-redhat-00001 to 4.0.37.Final-redhat-00001
- Closed
- relates to
-
EJBCLIENT-361 DiscoveryEJBClientInterceptor: static blacklist
- Resolved
-
JBEAP-18565 [GSS](7.2.z) EJBCLIENT-361 - DiscoveryEJBClientInterceptor: static blacklist
- Closed
- links to