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

bug: Server Game Time Exception #2394

Open
Irokaiser opened this issue Nov 16, 2024 · 2 comments
Open

bug: Server Game Time Exception #2394

Irokaiser opened this issue Nov 16, 2024 · 2 comments
Labels
bug Something isn't working needs verification Pending confirmation that the bug exists by another user.

Comments

@Irokaiser
Copy link
Contributor

Description

After running the server for ~24 hours this exception is thrown and the server shuts down.

Latest Intersect Build with no custom edits.

2024-11-16 01:46:14.645 [Error] Received unhandled exception from System.Threading.Thread: The added or subtracted value results in an un-representable DateTime. (Parameter 'value')

Server is now closing. Please wait while your game and player data is saved!

2024-11-16 01:46:14.663 [Error] ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'value')
    Stack:    at System.DateTime.ThrowDateArithmetic(Int32 param)
   at System.DateTime.AddTicks(Int64 value)
   at Intersect.Server.General.Time.Update() in /home/runner/work/TessaPrimeSource/TessaPrimeSource/Intersect.Server.Core/General/Time.cs:line 48
   at Intersect.Server.Core.LogicService.LogicThread.ThreadStart(ServerContext serverContext) in /home/runner/work/TessaPrimeSource/TessaPrimeSource/Intersect.Server.Core/Core/LogicService.LogicThread.cs:line 336

Steps to Reproduce

  • Run Latest Intersect Server Build (Bug encountered when running on Linux Ubuntu 22.04 environment)
  • Wait ~24 hours

Version with bug

0.8.0-beta.239

Last version that worked well

0.7.0 I think

Affected platforms

Linux, I was not able test on other platforms

Did you find any workaround?

No response

Relevant log output

2024-11-16 01:46:14.645 [Error] Received unhandled exception from System.Threading.Thread: The added or subtracted value results in an un-representable DateTime. (Parameter 'value')

Server is now closing. Please wait while your game and player data is saved!

2024-11-16 01:46:14.663 [Error] ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'value')
    Stack:    at System.DateTime.ThrowDateArithmetic(Int32 param)
   at System.DateTime.AddTicks(Int64 value)
   at Intersect.Server.General.Time.Update() in /home/runner/work/TessaPrimeSource/TessaPrimeSource/Intersect.Server.Core/General/Time.cs:line 48
   at Intersect.Server.Core.LogicService.LogicThread.ThreadStart(ServerContext serverContext) in /home/runner/work/TessaPrimeSource/TessaPrimeSource/Intersect.Server.Core/Core/LogicService.LogicThread.cs:line 336


### Duplicate Bug Check

- [X] This bug report is not a duplicate to the best of my knowledge.
@Irokaiser Irokaiser added bug Something isn't working needs verification Pending confirmation that the bug exists by another user. verified Issue has been verified as valid/existing. and removed needs verification Pending confirmation that the bug exists by another user. labels Nov 16, 2024
@Irokaiser
Copy link
Contributor Author

Irokaiser commented Nov 17, 2024

Encountered again, seemingly every 24 Hours.

@Arufonsu
Copy link
Contributor

Arufonsu commented Nov 18, 2024

Try this: within the time update method, add a try-catch block around where the time's Add method is called at in order to catch any ArgumentOutOfRangeException and reset the sGameTime to DateTime.Now if an exception occurs (this should prevent the server from crashing due to un-representable DateTime values).

https://diffy.org/diff/534a44ab91df4
time_fix_attempt.patch

Instead, please log your time rate by the time this is happening:
https://diffy.org/diff/7f14d321f842b

Thanks for reporting.

@Arufonsu Arufonsu added the help wanted Extra attention is needed label Nov 18, 2024
@Arufonsu Arufonsu added needs verification Pending confirmation that the bug exists by another user. and removed verified Issue has been verified as valid/existing. help wanted Extra attention is needed labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs verification Pending confirmation that the bug exists by another user.
Projects
None yet
Development

No branches or pull requests

2 participants