• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Long callback execution detected (hang or performance issue)
#2
https://github.com/Zeex/samp-plugin-cras...figuration

Quote:How long a top-level callback call should last before crashdetect prints a warning. This can be set very high (for example 1000000) to only detect functions that have totally hung, or very low (500) to detect functions that complete, but are just slow (thus affecting overall server execution and sync). Default value is 5000 (5 milliseconds).

Steps to take:



1- Find out how long exactly it takes to execute the code (You could use YSI's profiling: https://github.com/pawn-lang/YSI-Include..._profiling)

2- Check if commenting out "SaveWood(i);" still creates those errors (if it's writing to files, it could take some time if 2000 woods are being saved)

3- You could use y_iterate instead for looping. Rather than performing 2000 loops every minute you'd just loop through the existing woods



Apart from that, I don't understand the variable names so hard to tell exactly what's what and how it could be improved. Not to mention that not using tabs/spaces (atleast on this forum) makes it harder to read. Spaghetti code if you will.



An alternative would be to change the long_call_time parameter in your server configuration file. However that is pretty much just ignoring the problem -- especially if it hangs pretty long (causing desync and laggs). Otherwise you could slightly increase that value.
  Reply


Messages In This Thread
RE: Long callback execution detected (hang or performance issue) - by Kwarde - 2021-03-07, 12:07 PM

Forum Jump: