Skip to content

Session dispose exception #305

Open
Open

Description

@letarak

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

Activity

  1. alex-kulakov commented on Mar 9, 2023

    @alex-kulakov
    Contributor

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

  2. self-assigned this
    on Mar 9, 2023
  3. alex-kulakov commented on Mar 9, 2023

    @alex-kulakov
    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.

  4. letarak commented on Mar 10, 2023

    @letarak
    Author

    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

  5. alex-kulakov commented on Mar 20, 2023

    @alex-kulakov
    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.

  6. alex-kulakov commented on Mar 20, 2023

    @alex-kulakov
    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?

  7. letarak commented on Mar 21, 2023

    @letarak
    Author

    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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions