You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During a stress test with 8+ concurrent connections (2-core machine with hyperthreading) a to an embedded local database with 5M+ nodes while using ORecordCacheSoftRefs, Orient will sometimes fail to retrieve records due to NullPointerExceptions originated in the evictStaleEntries method of the underlying OSoftRefsHashMap cache.
In some heavily starved situations, reverseLookup.remove(sv) will return null:
Create N*2 ODatabaseDocumentTx instances pointing to the same plocal:// embedded database.
Run a long running query in all of them at once.
Some of the initial queries will work, but once Java starts to reclaim memory, some of the queries will start to fail.
I am not sure why the reverseLookup.remove(sv) call might be returning null: this happens even if I use a simple ThreadLocal<ODatabaseDocumentTx> instead of one of Orient's pools (ensuring each thread has its own instance).
Proposed fix
Adding a simple null check to the method seems to work fine:
OrientDB Version, operating system, or hardware.
2.2.8
Operating System
Linux (Ubuntu 16.04)
Expected behavior and actual behavior
During a stress test with 8+ concurrent connections (2-core machine with hyperthreading) a to an embedded local database with 5M+ nodes while using ORecordCacheSoftRefs, Orient will sometimes fail to retrieve records due to NullPointerExceptions originated in the
evictStaleEntries
method of the underlyingOSoftRefsHashMap
cache.In some heavily starved situations,
reverseLookup.remove(sv)
will returnnull
:Steps to reproduce the problem
I am not sure why the
reverseLookup.remove(sv)
call might be returning null: this happens even if I use a simpleThreadLocal<ODatabaseDocumentTx>
instead of one of Orient's pools (ensuring each thread has its own instance).Proposed fix
Adding a simple null check to the method seems to work fine:
The text was updated successfully, but these errors were encountered: