Skip to content

test/rgw/notifications: stabilize flaky persistent topic config tests - #70530

Merged
yuvalif merged 1 commit into
ceph:mainfrom
kchheda3:wip-71979-persistent-topic-flaky
Aug 5, 2026
Merged

yuvalif merged 1 commit into
ceph:mainfrom
kchheda3:wip-71979-persistent-topic-flaky

Conversation

@kchheda3

@kchheda3 kchheda3 commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

test_persistent_topic_configs_max_retries and test_persistent_topic_configs_ttl have been intermittently failing with an inflated persistent-queue entry count (e.g. 20 != 10 or 15 != 10): events from the create phase are still sitting in the queue when the delete phase runs, so the two phases' entries add up.

Root cause is timing, in two independent places:

  1. Queue discovery race. The notification manager only refreshes its list of persistent queues every rgw_notification_queue_update_period (30s by default). A queue created just after a refresh isn't picked up for processing until the next cycle, so the create-phase events may not have started retrying/expiring by the time the test checks the queue. This is the failure reported in the tracker. Fix: wait 30s after creating the topic (before generating any events) so the queue is discovered and owned first.

  2. Zero retry sleep in the ttl test. Leaving retry_sleep_duration as "None" falls back to rgw_topic_persistency_sleep_duration=0. Because the push endpoint here is intentionally unreachable, a 0s sleep makes the manager retry the same events hundreds of times per second — wasteful, and observed to wedge queue processing. Fix: set retry_sleep_duration=1 to pace the retries; expiry is still driven by time_to_live, so the assertions are unchanged.

Both changes are test-only.

Testing

Looping the affected tests on a vstart cluster:

  • test_persistent_topic_configs_max_retries: was reproducibly failing (~1 in 16 runs); passes consistently with change (1).
  • test_persistent_topic_configs_ttl: went from ~8/10 failures to ~9/10 passes with change (2).

Fixes: https://tracker.ceph.com/issues/71979

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@kchheda3
kchheda3 requested a review from a team as a code owner July 24, 2026 18:45
Copilot AI review requested due to automatic review settings July 24, 2026 18:45
@kchheda3
kchheda3 requested a review from yuvalif July 24, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Stabilizes RGW persistent-topic configuration tests by accounting for queue discovery timing and pacing retries.

Changes:

  • Adds a queue-discovery delay before generating events.
  • Sets a one-second retry interval for the TTL test.

Comment on lines +3639 to +3646
# wait for the persistent topic's queue to be discovered and owned by the
# notification manager before generating events. the manager only refreshes
# its list of queues every rgw_notification_queue_update_period (30s by
# default), so a queue created just after a refresh may not start being
# processed for up to that long. without this wait, events from the create
# phase can still be sitting in the queue (not yet retried/expired) when the
# delete phase runs, inflating the entry count and failing the assertions.
time.sleep(30)
@yuvalif

yuvalif commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@kchheda3 thanks for taking care of this long standing issue!

@kchheda3
kchheda3 force-pushed the wip-71979-persistent-topic-flaky branch from ff60fe3 to 20d5007 Compare July 27, 2026 15:21
Copilot AI review requested due to automatic review settings July 27, 2026 15:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/test/rgw/bucket_notification/test_bn.py:3650

  • This fixed delay does not actually guarantee that the manager has discovered and locked the queue: the refresh coroutine may be delayed by scheduling or RADOS operations, and there is no ownership check before events are generated. The PR's own TTL test result (~9/10 passes) confirms that the test remains flaky. Please wait on an observable ownership/processing condition with a bounded timeout (or add a test hook exposing it) rather than relying on wall-clock sleep.
    time.sleep(queue_discovery_period + 5)

@kchheda3

Copy link
Copy Markdown
Contributor Author

@kchheda3 thanks for taking care of this long standing issue!

the TTL failure is only specific to http manager code and was non trivial change and plus actual ceph code changes, mitigated by adding a sleep in ttl test, additionally i would be surprised if anyone uses http notification in productions, so did not add the tracker.

@yuvalif

yuvalif commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

the TTL failure is only specific to http manager code and was non trivial change and plus actual ceph code changes, mitigated by adding a sleep in ttl test, additionally i would be surprised if anyone uses http notification in productions, so did not add the tracker.

agree this is probably non-critical. lets see how annoying thoes intermittent failure are, and open a tracker if we have to...

@kchheda3

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

test_persistent_topic_configs_max_retries and
test_persistent_topic_configs_ttl have been intermittently failing with an
inflated entry count (e.g. "20 != 10" or "15 != 10"), where events from the
create phase are still in the persistent queue when the delete phase runs.

Two independent timing issues are addressed:

1. Queue discovery race. The notification manager refreshes its list of
   persistent queues once per fixed queues_update_period (a 30s constant in
   rgw_notify.cc, not a tunable), then still has to lock the queue and start
   processing before entries begin retrying/expiring. A queue created just
   after a refresh is not handled until the next cycle, so create-phase events
   may not have started expiring by the time the test checks the queue. Wait
   for more than one full period (period + margin) after creating the topic,
   before generating any events, so discovery is guaranteed to have happened;
   sleeping exactly one period can still race.

2. Zero retry sleep in the ttl test. Leaving retry_sleep_duration as "None"
   falls back to rgw_topic_persistency_sleep_duration=0. Since the push
   endpoint is intentionally unreachable, this makes the manager retry the
   same events hundreds of times per second, which is wasteful and has been
   observed to wedge queue processing. Set retry_sleep_duration=1 to pace the
   retries; expiry is still driven by time_to_live, so the assertions are
   unchanged.

Fixes: https://tracker.ceph.com/issues/71979
Signed-off-by: Krunal Chheda <[email protected]>
Copilot AI review requested due to automatic review settings July 31, 2026 15:47
@kchheda3
kchheda3 force-pushed the wip-71979-persistent-topic-flaky branch from 20d5007 to a55e2c1 Compare July 31, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@anrao19

anrao19 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-08-03-05:57.

@anrao19

anrao19 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-08-03-05:57.

pr testing completed and approved by @ivancich .
@kchheda3 , if no further testing is needed then this pr can be merged

@yuvalif
yuvalif merged commit d874ca0 into ceph:main Aug 5, 2026
6 checks passed
@kchheda3
kchheda3 deleted the wip-71979-persistent-topic-flaky branch August 10, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants