Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.CacheEntryFilterApply crash

淺唱寂寞╮ 提交于 2019-12-04 05:07:11

问题


I'm using Ignite.NET 2.7.6 and sometimes it crashes in

Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.CacheEntryFilterApply(long memPtr)

because var t == null and t.Invoke(stream) throws NullPointerException.

What I'm doing wrong to trigger this issue?

Added: stream.ReadLong() in mentioned method returns 0, so the expression

_ignite.HandleRegistry.Get(stream.ReadLong())

gets filter holder with id == 0, that look like invalid id.

Possible solution: I create scan query with a binary filter like this:

    cursor = cache.WithKeepBinary.Query(new ScanQuery(myFilter))

Later I use this cursor in a separate thread to collect the result: get an enumerator from it and iterate through objects.

But I had the logic mistake that could lead to the situation when the cursor becomes disposed, but the corresponding iterator calls MoveNext or Current. In this case no exception was thrown and JNI handler mentioned above was called, which led to the exception in it, which led to the undefined behavior of Ignite.

I'll look if the issue is solved and will report on results.


回答1:


I can confirm that a race condition is possible if IQueryCursor<K, V> instance is used from multiple threads, and one thread disposes it while another enumerates it.

Query cursors are not thread-safe, they are supposed to be used from a single thread.

Ticket filed: https://issues.apache.org/jira/browse/IGNITE-12348



来源:https://stackoverflow.com/questions/58632391/apache-ignite-core-impl-unmanaged-unmanagedcallbacks-cacheentryfilterapply-crash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!