joerghoh opened a new pull request, #63: URL: https://github.com/apache/sling-org-apache-sling-event/pull/63
When consumer-topic publication is enabled, ``JobConsumerManager`` registers a Discovery PropertyProvider . OSGi registration invokes service listeners synchronously, so the registration handle is not available until those callbacks return. A consumer binding or unbinding during this window can trigger the following sequence: 1. Provider registration starts with the current topic list. 2. A consumer changes the local consumer map before registration returns. 3. The binding callback sees no registration handle, treats publication as disabled, clears the topic list, and skips notifying Discovery. 4. Registration completes without recalculating or republishing the topics. Discovery can consequently retain missing consumer advertisements. Subsequent jobs may remain unassigned until another change triggers publication; registering another consumer for an already-known topic does not necessarily repair the state. ### Fix After provider registration returns, store the registration handle and recalculate topics from the current consumer map under the same lock. Then notify Discovery outside the lock so it rereads the corrected value. The notification is unconditional: Discovery may have cached an intermediate value even if concurrent additions and removals ultimately leave the consumer map unchanged. This adds one modification notification per provider registration. Registration access is coordinated through the consumer-map lock, while OSGi calls remain outside it to avoid blocking consumer callbacks. The topic value is volatile so Discovery can read it safely without acquiring that lock. ### Validation The regression IT forces a consumer to bind while provider registration is paused. It fails on the original implementation and passes with the fix, verifying that both topics reach Discovery and a submitted job executes without a repair update. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
