The MUD Development forum.
Game Development Discussion, Chat, Technical Debate, and people who just love games talking about building worlds.

Home » Hosted Mud Projects » Wheelmud » General » Logging in two separate sessions simultaneously crashes server - WheelMUD - A C# MUD Server - Forums
Logging in two separate sessions simultaneously crashes server - WheelMUD - A C# MUD Server - Forums [message #461] Sun, 22 March 2015 11:44
Karak is currently offline  Karak
Messages: 489
Registered: March 2015
Location: Seattle, WA
Senior Member
Wheelmud
This thread originates from prior WheelMUD forum software archives. It has been migrated here to preserve the contents.

Post by JFed (31 May 2012 11:27 AM):
To reproduce: Attempt to login two players at approximately the same time. Works fine if I do it slower.
--
System.InvalidOperationException was caught
<div> Message=You cannot open a session or access the database commands before initializing the document store. Did you forget calling Initialize(Wink?[/quote]
<div> Source=Raven.Client.Lightweight[/quote]
<div> StackTrace:[/quote]
<div> at Raven.Client.DocumentStoreBase.AssertInitialized(Wink[/quote]
<div> at Raven.Client.Document.DocumentStore.get_DatabaseCommands(Wink[/quote]
<div> at Raven.Client.Document.DocumentStore.OpenSession(OpenSessionO ptions options)[/quote]
<div> at Raven.Client.Document.DocumentStore.OpenSession(Wink[/quote]
<div> at WheelMUD.Data.RavenDb.DalUtils.GetRavenSession(Wink in C:\WheelMUDSharp\src\Data.RavenDb\DalUtils.cs:line 52[/quote]
<div> at WheelMUD.Data.RavenDb.DocumentManager.LoadPlayerDocument(Int 64 databaseId) in C:\WheelMUDSharp\src\Data.RavenDb\DocumentManager.cs:line 47[/quote]
<div> at WheelMUD.Core.PlayerManager.LoadPlayerDocument(Int64 databaseId) in C:\WheelMUDSharp\src\Core\ManagerSystems\PlayerManager.cs:li ne 462[/quote]
<div> at WheelMUD.Core.PlayerManager.OnSessionAuthenticated(Session session) in C:\WheelMUDSharp\src\Core\ManagerSystems\PlayerManager.cs:li ne 281[/quote]
<div> at WheelMUD.Core.SessionManager.OnSessionAuthenticated(Session session) in C:\WheelMUDSharp\src\Core\ManagerSystems\SessionManager.cs:l ine 120[/quote]
<div> at WheelMUD.Core.Session.AuthenticateSession(Wink in C:\WheelMUDSharp\src\Core\Session\Session.cs:line 101[/quote]
<div> at WheelMUD.ConnectionStates.LoginState.ProcessInput(String command) in C:\WheelMUDSharp\src\ConnectionStates\LoginState.cs:line 45[/quote]
<div> at WheelMUD.Core.Session.ProcessCommand(String input) in C:\WheelMUDSharp\src\Core\Session\Session.cs:line 111[/quote]
<div> at WheelMUD.Core.SessionManager.OnInputReceived(IConnection connection, String input) in C:\WheelMUDSharp\src\Core\ManagerSystems\SessionManager.cs:l ine 144[/quote]
<div> at WheelMUD.Server.ServerManager.CommandServer_OnInputReceived( Object sender, ConnectionArgs args, String input) in C:\WheelMUDSharp\src\Server\ServerManager.cs:line 173[/quote]
<div> at WheelMUD.Server.InputParser.RaiseInputReceived(ConnectionArg s connectionArgs, String action) in C:\WheelMUDSharp\src\Server\InputParser.cs:line 168[/quote]
<div> at WheelMUD.Server.InputParser.OnDataReceived(IConnection sender, Byte[] data) in C:\WheelMUDSharp\src\Server\InputParser.cs:line 99[/quote]
<div> at WheelMUD.Server.ServerManager.ProcessIncomingData(IConnectio n sender, Byte[] data) in C:\WheelMUDSharp\src\Server\ServerManager.cs:line 160[/quote]
<div> at WheelMUD.Server.ServerManager.BaseServer_OnDataReceived(Obje ct sender, ConnectionArgs args) in C:\WheelMUDSharp\src\Server\ServerManager.cs:line 207[/quote]
<div> at WheelMUD.Server.BaseServer.EventHandlerDataReceived(Object sender, ConnectionArgs args) in C:\WheelMUDSharp\src\Server\BaseServer.cs:line 270[/quote]
<div> at WheelMUD.Server.Connection.OnDataReceived(IAsyncResult asyncResult) in C:\WheelMUDSharp\src\Server\Connection.cs:line 304[/quote]
<div> InnerException: [/quote]
<div> [/quote]

Post by Fastalanasa (31 May 2012 01:23 PM):
Could you please create a bug entry in JIRA? Make sure to comment on how you got two sessions to connect almost simultaneously.

Post by JFed (31 May 2012 02:49 PM):
I don't think I have a JIRA account yet.

I was testing emotes when I discovered this bug. Start server, open two terminal windows, both at the initial splash screen. Log in Window 1 test/test, log in Window 2 (for me, asd/asd) without waiting and it crashes. It seems there is a small delay (a few seconds) when the first user logs in after the server is freshly booted (initial database loads?Wink. If another user tries to login during this delay, the error is produced.

Post by JFed (01 Jun 2012 06:26 PM):
WMSHARP-121 created. PS: Liking JIRA so far!

Post by Karak (02 Jun 2012 07:51 PM):
Related: There is some init stuff that is only occurring when the first player logs in, IE the first player has a bit of a wait but players beyond that log in fast. From the stack, I'm guessing this is preparing the DB. This is probably the period of time where the second login is slipping in, causing double-init. May just need a simple lock around such init to avoid double-inits, but it wouldn't hurt to also look into getting the DB init stuff to start happening automatically while the server fires up rather than when the first player is logging in.
Previous Topic: Missing DLL's on new build 1425 - WheelMUD - A C# MUD Server - Forums - WheelMUD - Bug Reports
Next Topic: Fastalanasa is on vacation - WheelMUD - A C# MUD Server - Forums - General - Lounge
Goto Forum:
  


Current Time: Thu Nov 23 08:47:01 PST 2017