GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [fix][client] Release a timed-out send's memory and permit before completing it by merlimat · Pull Request #27567 · apache/pulsar Conversation
Contributor
Motivation
It's a client bug, not a test bug. When the send timeout fires, for (int i = 0; i < pendingMessagesToFailCount; i++) { OpSendMsg op = pendingMessages.remove(); releaseCount.addAndGet(batchMessagingEnabled ? op.numMessagesInBatch : 1); ... op.sendComplete(ex); // completes the user's future ... client.getMemoryLimitController().releaseMemory(op.uncompressedSize); // memory released afterwards releaseOpCmdAndRecycle(op); } semaphoreRelease(releaseCount.get()); // permits released after the loop
This affects applications too, not just the test: a send callback that retries (the loop deliberately keeps "newly added messages by synchronous retries") still finds the failed message's memory and permit held. With a full memory limit or queue, the retry gets Modifications
Verifying this change
Follow-up, not in this PR: the incompatible-schema branch of the pending-queue resend (
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…pleting it ProducerImpl.failPendingMessages, which the send timeout uses to fail the queued messages, completed each op's callback first and only then gave its memory back to the MemoryLimitController (and its permits back to the pending-queue semaphore after the whole queue). A caller woken by the failed send, or retrying from its callback, could still see them held. This is what makes ProducerMemoryLimitTest.testProducerTimeoutMemoryRelease flaky (expected [0] but found [11]). Release each op's accounting with releaseSemaphoreForSendOp before completing its callback, as the ack and the other failure paths do. …l-pending-release-before-callback
codelipenghui
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
merlimat
deleted the
mmerli/producer-fail-pending-release-before-callback
branch
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…pleting it (apache#27567) (cherry picked from commit 0c0cb36)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…pleting it (apache#27567) (cherry picked from commit 0c0cb36)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |