You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by am...@apache.org on 2026/06/04 19:51:18 UTC
(aries-rsa) 02/02: ARIES-2232 Fix TCP Discovery InterestManager not notifying listeners when scope changes
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 2858b5ffefe2f544141efb5ac93061ee94cba8c0
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Wed Jun 3 20:02:37 2026 +0300
ARIES-2232 Fix TCP Discovery InterestManager not notifying listeners when scope changes
---
.../org/apache/aries/rsa/discovery/tcp/InterestManager.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/discovery/tcp/src/main/java/org/apache/aries/rsa/discovery/tcp/InterestManager.java b/discovery/tcp/src/main/java/org/apache/aries/rsa/discovery/tcp/InterestManager.java
index 6c9c0365..5abdfc75 100644
--- a/discovery/tcp/src/main/java/org/apache/aries/rsa/discovery/tcp/InterestManager.java
+++ b/discovery/tcp/src/main/java/org/apache/aries/rsa/discovery/tcp/InterestManager.java
@@ -48,13 +48,13 @@ public class InterestManager {
// an existing listener is not notified, but we do need to update its scopes (interest)
Interest interest = new Interest(sref, listener);
interests.put(sref, interest); // if it already exists - replace it with the new interest (scopes)
- LOG.trace("Updated interest {} (new={})", interest, isNew);
- if (isNew) {
- // notify new listener of all known remote endpoints
- remoteEndpoints.values().stream()
- .flatMap(endpoints -> endpoints.values().stream())
+ LOG.trace("Updated interest {} (new={})", isNew, interest);
+ // notify new or updated listener of all known remote endpoints
+ // (according to the spec, the listener is idempotent so we don't worry about ADDED duplicates)
+ LOG.debug("Notifying new interest {} of all known remote endpoints {}", interest, remoteEndpoints.values());
+ remoteEndpoints.values().stream()
+ .flatMap(endpoints -> endpoints.values().stream())
.forEach(endpoint -> interest.notifyListener(new EndpointEvent(ADDED, endpoint)));
- }
}
public void removeListener(ServiceReference<EndpointEventListener> sref) {