KAFKA-5239: Producer buffer pool allocates memory inside a lock#3053
KAFKA-5239: Producer buffer pool allocates memory inside a lock#3053smccauliff wants to merge 4 commits intoapache:trunkfrom
Conversation
Add unit test for restoring count when OOM is thrown from byte buffer allocation. i
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
| private final Deque<Condition> waiters; | ||
| /** This memory is accounted for separately from the poolable buffers in free. */ | ||
| /** Poolable + non-poolable memory. */ | ||
| private long availableMemory; |
There was a problem hiding this comment.
If we change the definition of the available memory here, we may have to change a few other places as well. e.g. deallocate(), unallocatedMemory(), etc.
There was a problem hiding this comment.
I added the original comment; it is not correct.
There was a problem hiding this comment.
Lines 234-236 confused me. But I see that freeUp() will potentially add the count of bytes back into availableMemory.
There was a problem hiding this comment.
Thanks for the explanation. It seems the comment were still not updated? Have you pushed the change?
There was a problem hiding this comment.
/** Poolable + non-poolable memory. */ is the correct comment. No?
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Thanks for the patch. LGTM. |
|
Not sure if it's related, but the following test failed in Jenkins: |
|
@ijuma I ran the tests a couple of times locally and cannot reproduce the issue. It seems an intermittent failure related to the |
Move byte buffer allocation out of lock.
Add unit test for restoring count when OOM is thrown from byte buffer allocation.