Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.CacheEntryFilterApply崩溃 [英] Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.CacheEntryFilterApply crash

查看:40
本文介绍了Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.CacheEntryFilterApply崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ignite.NET 2.7.6,有时它会崩溃

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

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

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

因为var t == null,并且t.Invoke(stream)抛出NullPointerException.

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

我做错了什么才能触发此问题?

What I'm doing wrong to trigger this issue?

已添加:stream.ReadLong()在上述方法中返回0,因此表达式

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

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

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

获得ID == 0的过滤器支架,看起来像无效的ID.

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.

但是我有一个逻辑错误,该错误可能导致游标被放置时的情况,但是相应的迭代器调用MoveNext或Current.在这种情况下,不会引发任何异常,并且会调用上面提到的JNI处理程序,从而导致其中的异常,从而导致Ignite的行为未定义.

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.

推荐答案

如果从多个线程中使用 IQueryCursor< K,V> 实例,则我可以确认是否存在竞争条件处理它,而另一个枚举它.

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.

提交的机票: https://issues.apache.org/jira/browse/IGNITE-12348

这篇关于Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.CacheEntryFilterApply崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆