FWGS / hlsdk-portable

Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
https://xash.su
Other
266 stars 121 forks source link

Finding a reason of server crash on the online change #424

Closed d47081 closed 7 months ago

d47081 commented 7 months ago

After enabling dynamical add/remove bots on online change (by min/max settings), found an issue - server crashes sometimes. It mostly happened when more than one players online

With permanent quantity of bots is no problems

As commented in code, there is could be timeout reason.

Please do not merge this PR until testing on YGGverse server will be completed. But this one commit would be included here.

a1batross commented 7 months ago

Try to run engine with sanitizers enabled (It's -T sanitize option in waf configure) and with debugger attached. Also enable verbose logging in engine, it's -dev 2 flag to Xash.

a1batross commented 7 months ago

It might as well be the bug in the engine. =/

d47081 commented 7 months ago

By the way, maybe I forgot to add respawn_time = gpGlobals->time + 1.0; in PR #422

This reason is deeper anyway, some issues with memory going as bots started to respawn with random params and ignore configuration.

It works for some time but later something happened, it looks like memory control issues. Probably in the engine - will try to recompile, thanks for advice

d47081 commented 7 months ago

I've also added missed timing delay https://github.com/FWGS/hlsdk-portable/pull/424/commits/09c481fb8e6331ea3233c374bd616fadc0459a45

Suppose that will fix the problem as is, let me test for some time

d47081 commented 7 months ago

I have returned integer value for timeout offset, another values could be optimized by another PR.

Server get crashed few hours before, no relation with players / max online / min bots quantity

image

Running server with -dev 2 to catch more info.. Suppose it also could be related with map rotate event - when some players exists, but gone and bot can't respawn

d47081 commented 7 months ago

Closing this PR as important changes included in #426

This branch could require lot of manual resolving on finally merge.