Skip to content

Intermittent errors when resolving game sessions #24

Description

@jmderuty

Intermittently, an error occurs in the default game finder resolver. This is probably a concurrency issue.

  {
    "message": "An unhandled async exception occurred : 'System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.)\n ---> System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.\n   at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException()\n   at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest& request)\n   at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass3_0`1.<ResolveInstance>b__0()\n   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)\n   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)\n   at System.Lazy`1.CreateValue()\n   at Stormancer.Server.Plugins.GameSession.GameSessions.Create(String template, String id, GameSessionConfiguration config, CancellationToken cancellationToken) in /_/src/Stormancer.Plugins/GameSession/Stormancer.Server.Plugins.GameSession/IGameSessions.cs:line 140\n   at Stormancer.Server.Plugins.GameFinder.PartyGameFinderResolver.ResolveGame(IGameResolverContext gameCtx) in /_/src/Stormancer.Plugins/GameFinder/Stormancer.Server.Plugins.GameFinder/PartyGameFinder/PartyGameFinderResolver.cs:line 104\n   at Stormancer.Server.Plugins.GameFinder.GameFinderService.ResolveGameFound(IGameCandidate gameCandidate, Dictionary`2 waitingParties, IGameFinderResolver resolver, CancellationToken cancellationToken) in /_/src/Stormancer.Plugins/GameFinder/Stormancer.Server.Plugins.GameFinder/GameFinderService.cs:line 483\n   at Stormancer.Server.Plugins.GameFinder.GameFinderService.ResolveGameFound(IGameCandidate gameCandidate, Dictionary`2 waitingParties, IGameFinderResolver resolver, CancellationToken cancellationToken) in /_/src/Stormancer.Plugins/GameFinder/Stormancer.Server.Plugins.GameFinder/GameFinderService.cs:line 615\n   --- End of inner exception stack trace ---'",
    "data": {
      "content": {
        "Type": "AggregateException",
        "Message": "A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.)",
        "Frames": [],
        "InnerExceptions": [
          {
            "Type": "ObjectDisposedException",
            "Message": "Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.",
            "Frames": [ "   at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException()", "   at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest& request)", "   at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass3_0`1.<ResolveInstance>b__0()", "   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)", "   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)", "   at System.Lazy`1.CreateValue()", "   at Stormancer.Server.Plugins.GameSession.GameSessions.Create(String template, String id, GameSessionConfiguration config, CancellationToken cancellationToken) in /_/src/Stormancer.Plugins/GameSession/Stormancer.Server.Plugins.GameSession/IGameSessions.cs:line 140", "   at Stormancer.Server.Plugins.GameFinder.PartyGameFinderResolver.ResolveGame(IGameResolverContext gameCtx) in /_/src/Stormancer.Plugins/GameFinder/Stormancer.Server.Plugins.GameFinder/PartyGameFinder/PartyGameFinderResolver.cs:line 104", "   at Stormancer.Server.Plugins.GameFinder.GameFinderService.ResolveGameFound(IGameCandidate gameCandidate, Dictionary`2 waitingParties, IGameFinderResolver resolver, CancellationToken cancellationToken) in /_/src/Stormancer.Plugins/GameFinder/Stormancer.Server.Plugins.GameFinder/GameFinderService.cs:line 483", "   at Stormancer.Server.Plugins.GameFinder.GameFinderService.ResolveGameFound(IGameCandidate gameCandidate, Dictionary`2 waitingParties, IGameFinderResolver resolver, CancellationToken cancellationToken) in /_/src/Stormancer.Plugins/GameFinder/Stormancer.Server.Plugins.GameFinder/GameFinderService.cs:line 615" ],
            "InnerExceptions": []
          }
        ]
      },
      "app": "/darktales/live-1-00-04/7308ada5-50fb-4b86-8ab6-f32a7b5ea0e4/4?"
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Gamefinderwork items related to Stormancer.Server.Plugins.GamefinderbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions