merlimat opened a new pull request, #25354:
URL: https://github.com/apache/pulsar/pull/25354

   ## Flaky test failure
   
   ```
   ShadowTopicTest.testConsumeShadowMessageWithoutCache:253 ยป ThreadTimeout
   Method 
org.apache.pulsar.broker.service.persistent.ShadowTopicTest.testConsumeShadowMessageWithoutCache()
   didn't finish within the time-out 300000
   ```
   
   ## Summary
   
   - Fix `ShadowTopicTest.testConsumeShadowMessageWithoutCache` which hangs 
indefinitely (5min timeout).
   - The test creates a shadow topic without enabling the shadow replicator, 
expecting the `ShadowManagedLedgerImpl` to read entries directly from the 
source's BookKeeper ledgers via metadata watch.
   - The shadow ML discovers entries via `processSourceManagedLedgerInfo`, but 
open ledgers have `entries=0` in the metadata and are skipped (`if 
(ledgerInfo.getEntries() > 0)`). Without a ledger rollover, the shadow topic 
never sees any entries and `consumer.receive()` blocks forever.
   - Fix: unload the source topic before creating the shadow topic. Unloading 
triggers a ledger rollover, closing the current ledger so its entries become 
visible in the metadata.
   - Also add timeouts to `consumer.receive()` calls to fail fast with a clear 
error instead of hanging for 5 minutes.
   
   ## Documentation
   
   - [x] `doc-not-needed`
   (Your PR doesn't need any doc update)
   
   ## Matching PR in forked repository
   
   _No response_
   
   ### Tip
   
   Add the labels `ready-to-test` and `area/test` to trigger the CI.


-- 
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]

Reply via email to