Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session dispose exception #305

Open
letarak opened this issue Mar 3, 2023 · 6 comments
Open

Session dispose exception #305

letarak opened this issue Mar 3, 2023 · 6 comments
Assignees

Comments

@letarak
Copy link

letarak commented Mar 3, 2023

DO 7.0
Sorry, can not reproduce in test environment
Catch this exception three times

System.ArgumentNullException: Value cannot be null. (Parameter 'node')
   at System.Collections.Generic.LinkedList`1.ValidateNode(LinkedListNode`1 node)
   at Xtensive.Collections.TopDeque`2.PopBottom() in /_/Orm/Xtensive.Orm/Collections/TopDeque.cs:line 180
   at Xtensive.Caching.LruCache`2.Clear() in /_/Orm/Xtensive.Orm/Caching/LruCache{TKey, TItem}.cs:line 159
   at Xtensive.Orm.Session.DisposeImpl(Boolean isAsync) in /_/Orm/Xtensive.Orm/Orm/Session.cs:line 661
   at Xtensive.Orm.Session.Dispose() in /_/Orm/Xtensive.Orm/Orm/Session.cs:line 614
System.InvalidOperationException: The LinkedList node does not belong to current LinkedList.
   at System.Collections.Generic.LinkedList`1.ValidateNode(LinkedListNode`1 node)
   at Xtensive.Collections.TopDeque`2.PopBottom() in /_/Orm/Xtensive.Orm/Collections/TopDeque.cs:line 180
   at Xtensive.Caching.LruCache`2.Clear() in /_/Orm/Xtensive.Orm/Caching/LruCache{TKey, TItem}.cs:line 159
   at Xtensive.Orm.Session.DisposeImpl(Boolean isAsync) in /_/Orm/Xtensive.Orm/Orm/Session.cs:line 661
   at Xtensive.Orm.Session.Dispose() in /_/Orm/Xtensive.Orm/Orm/Session.cs:line 614
@alex-kulakov
Copy link
Contributor

Hello @letarak , so this appears in some conditions on production? Does it fail all the time?

@alex-kulakov alex-kulakov self-assigned this Mar 9, 2023
@alex-kulakov
Copy link
Contributor

Did the problem appear on a version which was publicly available as a release (7.0.3, 7.0.2 etc.) or it is on latest changes on 7.0 branch? I need the version or the commit in case it was built by you on some commit of 7.0 branch. This is important to identify whether it is old problem or has just appeared.

@letarak
Copy link
Author

letarak commented Mar 10, 2023

Yes, catch on production, but very rarely (5 times total in 3-4 month)
Precise version 7.0.3

Exception seen only in two blocks of code, each of them use nested session scope
Nested session use entity instance from outer scope
Hope this helps

@alex-kulakov
Copy link
Contributor

Hmmm... I'll try to reproduce it but probably it will be a hard-to-catch bug. Thank you for the info. If some additional details appear, please post them.

@alex-kulakov
Copy link
Contributor

I stumbled across this post in which it is told that errors like "The LinkedList node does not belong to current LinkedList" in concurrent access. Are you sure that there is no hidden switching between sessions? Do you use Session.Activate() and Session.Current in such cases?

@letarak
Copy link
Author

letarak commented Mar 21, 2023

No, we do not use Session.Activate()
maybe Session.Current with custom resolver
and this can activate session without our help :)

I need check this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants