Game Server stops accepting clients after a week

We’ve recently discovered an issue with our dedicated game servers where if they have been running for more than about a week they stop responding to new clients. Due to the nature of this issue it’s rather hard to trace, since the server’s LogNet log doesn’t even mention the client sent a packet to the server at all.

Where should I start to try figuring this out?

It seems the answer might lie in our code. Apparently, if a socket fails to connect, it doesn’t implicitly close and must still be closed manually, even if the socket gets destroyed (NFC why this doesn’t happen but whatever).

Moral of the story: Don’t assume destructors are properly destroying their sub-objects, I guess…

Edit: Actually, this seems to be an issue with the underlying network driver, though the dangling socket issue above was still a thing.

You’ll need to edit the following files:

Files:
Engine/Source/Runtime/Engine/Classes/AI/Navigation/AvoidanceManager.h
Engine/Source/Runtime/Engine/Classes/Camera/PlayerCameraManager.h
Engine/Source/Runtime/Engine/Classes/Engine/NetDriver.h
Engine/Source/Runtime/Engine/Classes/Engine/NetworkObjectList.h
Engine/Source/Runtime/Engine/Classes/Engine/World.h
Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h
Engine/Source/Runtime/Engine/Classes/GameFramework/CharacterMovementComponent.h
Engine/Source/Runtime/Engine/Classes/GameFramework/GameNetworkManager.h
Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h
Engine/Source/Runtime/Engine/Private/AI/Navigation/AvoidanceManager.cpp
Engine/Source/Runtime/Engine/Private/NetworkDriver.cpp
Engine/Source/Runtime/Engine/Private/PacketHandlers/StatelessConnectHandlerComponent.cpp
Engine/Source/Runtime/Engine/Private/PlayerCameraManager.cpp
Engine/Source/Runtime/Engine/Public/PacketHandlers/StatelessConnectHandlerComponent.h

Basically making the floats into doubles.

Here’s a paste that shows our house edits to accomplish this: