Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat, follow up #20401

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented May 25, 2023

Fixes #20386

Motivation

Modifications

  • improve the fix and rely on the fact that entryId is -1 when the message is dropped in the broker
    code:
    // avoid processing non-persist message if reached max concurrent-message limit
    if (nonPersistentPendingMessages > maxNonPersistentPendingMessages) {
    final long producerId = send.getProducerId();
    final long sequenceId = send.getSequenceId();
    final long highestSequenceId = send.getHighestSequenceId();
    service.getTopicOrderedExecutor().executeOrdered(producer.getTopic().getName(), () -> {
    commandSender.sendSendReceiptResponse(producerId, sequenceId, highestSequenceId, -1, -1);
    });
    producer.recordMessageDrop(send.getNumMessages());
    return;
    } else {
    nonPersistentPendingMessages++;
    }

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

…llow up

- the previous attempt apache#20387 to fix the flakiness wasn't effective
- improve the fix
@lhotari lhotari added this to the 3.1.0 milestone May 25, 2023
@lhotari lhotari requested review from tisonkun and nicoloboschi May 25, 2023 08:45
@lhotari lhotari self-assigned this May 25, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label May 25, 2023
@lhotari lhotari requested a review from michaeljmarshall May 25, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test type/flaky-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky-test: NonPersistentTopicTest.testMsgDropStat
2 participants