Closed sweepies closed 5 years ago
Looks like there was a character entered in the rcon console which resulted in the letter q
being present before hostname
in the status
output. Definitely a strange issue. Perhaps implement a protection against mangled output like this or throw a different exception? I'll leave this open for now.
Another thing I just noticed, calling updatePlayers() many times within a short period of time will result in:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.github.koraktor.steamcondenser.steam.sockets.RCONSocket.getReply(RCONSocket.java:119)
at com.github.koraktor.steamcondenser.steam.servers.SourceServer.rconExec(SourceServer.java:182)
at com.github.koraktor.steamcondenser.steam.servers.GameServer.updatePlayers(GameServer.java:539)
at com.github.koraktor.steamcondenser.steam.servers.GameServer.updatePlayers(GameServer.java:509)
and immediately memory usage skyrocketed from 40MiB to 3GiB subsequently resulting in:
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
at com.github.koraktor.steamcondenser.steam.sockets.SteamSocket.receivePacket(SteamSocket.java:120)
at com.github.koraktor.steamcondenser.steam.sockets.RCONSocket.getReply(RCONSocket.java:118)
at com.github.koraktor.steamcondenser.steam.servers.SourceServer.rconExec(SourceServer.java:182)
at com.github.koraktor.steamcondenser.steam.servers.GameServer.updatePlayers(GameServer.java:539)
at com.github.koraktor.steamcondenser.steam.servers.GameServer.updatePlayers(GameServer.java:509)
Memory usage remained at 1.72GiB after GC and the only way to fix this is to restart the process.
Sorry for the late response. Does the original issue occur when no bots are on the server?
Can you provide a packet trace (e.g. using Wireshark or tcpdump) of the second issue (many requests in a short timeframe)?
@sweepyoface: I can’t seem to reproduce this error (even when injecting your status
output exactly). What exactly did you edit?
PS: Are you using threads for your quick requests? The socket code is not thread-safe.
I'm trying to figure out the best way of diagnosing and providing more information about this issue, I'll have to redeploy it and look into this. This could very well be an issue with my code and needs a fresh read.
@sweepyoface Any update on this?
Completely forgot about this – I've deprecated that project having progressed a lot (making that code base look like a horrible mess), and I've mostly moved on from Java so will probably be rewriting it in Node.
This issue was likely my fault and I don't have plans to run that again, but thanks for the help.
output of
status
(edited):The game is Garry's Mod if that makes a difference.