[
https://issues.apache.org/jira/browse/HBASE-18375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091170#comment-16091170
]
ramkrishna.s.vasudevan commented on HBASE-18375:
------------------------------------------------
bq.3. When S is closed, C is returned to ChunkCreator, which in turn returns C
to the pool, but in parrallel the GC is already freeing C's "unreachable"
ByteBuffer.
and this
bq. However, while S is closed the chunks are released to ChunkCreator and the
following code is invoked:
So you say that the ByteBuffer inside the 'Chunk' becomes null and so
referencing the BB inside the chunk gives you NPE or is it the Chunk itself
being NULL? Can you paste the stack trace here?
{code}
Chunk chunk = ChunkCreator.this.removeChunk(chunkId);
if (chunk != null) {
if (chunk.isFromPool() && toAdd > 0) {
reclaimedChunks.add(chunk);
}
toAdd--;
}
{code}
So here if we have 'chunk' ref available then there is no problem and you see
that some time you don't get the chunk ref itself and so it is not getting
added to reclaimedChunks at all? And so next time you are not able to poll from
the reclaimedchunks?
If you are always going with strongChunkMap if there is a pool then that
'saveFromGC' also can be avoided while using CellChunkMap if there was a pool
already in place? Sorry for taking my time as I just want to be clear on the
problem. I may be missing something as you have already seen the issue but it
is just to be sure that we are on the same page.
> The pool chunks from ChunkCreator are deallocated while in pool because there
> is no reference to them
> -----------------------------------------------------------------------------------------------------
>
> Key: HBASE-18375
> URL: https://issues.apache.org/jira/browse/HBASE-18375
> Project: HBase
> Issue Type: Sub-task
> Affects Versions: 2.0.0-alpha-1
> Reporter: Anastasia Braginsky
> Priority: Critical
> Fix For: 2.0.0, 3.0.0, 2.0.0-alpha-2
>
> Attachments: HBASE-18375-V01.patch, HBASE-18375-V02.patch,
> HBASE-18375-V03.patch
>
>
> Because MSLAB list of chunks was changed to list of chunk IDs, the chunks
> returned back to pool can be deallocated by JVM because there is no reference
> to them. The solution is to protect pool chunks from GC by the strong map of
> ChunkCreator introduced by HBASE-18010. Will prepare the patch today.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)