Please help! - CManagedHost::OnDomainUnload() - 2

Options
xiqiang
xiqiang
edited December 2013 in Photon Server
Sorry,my English is not good.

The server may shutdown after running 1 or more days.
I have no idea to find the problem, perhaps you could provide clues

Server SDK version: ExitGames-Photon-Server-SDK_v3-2-10-4248
The server running as 32 bit app on 64 bit platform(CPU:Xeon E5-2430)

Here is partial of logs:
2916: 10:30:23.775 - Service is running...
4876: 21:39:48.830 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
4876: 21:39:48.830 - CManagedHost::OnTimeout() - OPR_FinalizerRun - eUnloadAppDomain
4876: 21:39:48.830 - CManagedHost::OnDefaultAction() - OPR_AppDomainUnload - eUnloadAppDomain
1496: 21:39:48.846 - Unloading Domain: ApplicationName = 'itk', DomainId='2'
4876: 21:39:53.893 - CManagedHost::OnDomainUnload() - 2
4876: 21:39:53.893 - Releasing reference on default app domain
4876: 21:39:53.893 - Restarting application: "itk" due to unexpected unload
4876: 21:39:53.893 - Application: "itk" restart request (abort existing connections)

Comments

  • xiqiang
    Options
    Server config file:
  • chvetsov
    Options
    Hi, xiqiang.

    As i may see from your logs. You have exception in your code.

    ФЪ MySql.Data.Common.MyNetworkStream.HandleOrRethrowException(Exception e)
    ФЪ MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
    ФЪ MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
    ФЪ System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
    ФЪ MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
    ФЪ MySql.Data.MySqlClient.MySqlStream.LoadPacket()
    ФЪ MySql.Data.MySqlClient.MySqlStream.ReadPacket()
    ФЪ MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
    ФЪ MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
    ФЪ MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
    ФЪ MySql.Data.MySqlClient.MySqlDataReader.NextResult()
    ФЪ MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
    ФЪ MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
    ФЪ itkserver.ServerAccount.SaveMission(ServerMission mission)
    ФЪ itkserver.ServerAccount.SaveMissions()
    ФЪ itkserver.ServerAccount.SaveData_Player()

    I assume, that this exception is not handle by you. It is handled by PhotonServer code. default decision for unhandled exception is reloading domain.
    You should understand why MySqlClient generates exception. May be he lost connection because of timeout and you need restore it. May be it is some internal MySqlClient bug.

    It is clear that this is not PhotonServer bug or your PhotonServer configuration bug. And it is clear that you should solve this problem. We are not able to help you here
  • xiqiang
    Options
    Thanks for your reply, chvetsov.
  • xiqiang
    Options
    Hi,chvetsov.

    After a detailed view, I found the exception in itk.log was not the reason that caused the server shutdown.
    I guess, the exceptions may caused by some operation like "Thread.Abort()" when domain reloading.
    Of course this is not PhotonServer bug, is there any way to get the reason of "UnloadAppDomain" ?
    Very thankful!

    The logs ordered by time:
    21:39:48.830 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
    21:39:48,846 [ 2] ERROR PhotonHostRuntime.PhotonDomainManager - UnhandledException:
    System.Threading.ThreadAbortException
    21:39:53,877 [9] ERROR itkserver.ServerAccount [(null)] - 账户: 保存失败(12215):System.Threading.ThreadAbortException
  • chvetsov
    Options
    Well, right now, i can not give you any information, because almost all peaple in the office are on vacation.
    I do not have access to code. But what i can recomend is, try to cover your code with exception handlers, it may happen that some uncought exception happened in you code.

    Right, i can not help you more. I'm also going to vacation
  • xiqiang
    Options
    OK,Merry Christmas :)
  • chvetsov
    Options
    One more guy has same problem us you. Please check log folder for dump files, upload them and share link with us
    we will check
  • xiqiang
    Options
    I did not find dump files in that folder,will pay attention next time when the same thing happened.
    We now writing exception handlers in domain, and adding more logs to try to find the problem.

    Thanks!