ID:1568418
 
BYOND Version:506
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 34.0.1847.131
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
You recently tried to fix Export(), but I believe it is still broken, but perhaps in a different way than before. On my game we never had any problems with Export() anyway, but since the "fix" and after we updated from 506.1241 (I think) to 506.1245 Export() has been freezing our game constantly.

It is fine for maybe 5 minutes tops then it'll stay frozen until we restart the server.

So I defined Export() like this to prevent it from running:

world/Export()
return


And now we have been up for 5 hours straight without any freezing. Everything else in the game is unaltered from its previous state.

The error log is spammed with "BUG: Http error: HTTP server returned unexpected status: 404 Not Found" if that tells you anything, but it always has been spammed with that even when we used BYOND 504 and earlier, and it never caused us any freezes, so it is probably unrelated.

We are running on a Linux system with threading on.

Here is the code we use Export() for if you can make any sense of it:

mob/proc/Get_Packs()
var/serverurl ="falsecreations.com"
var/http1[]=world.Export("http://falsecreations.com/.byond/zeepackages/")
if(!http1)
src<<"The package server is currently unavailable. Connecting to backup server.."
http1=world.Export("http://209.141.52.69/.byond/zeepackages/")
serverurl="209.141.52.69"
if(!http1)
src<<"Backup server did not respond. Try again later."
return
var/list/L=list("Scatter_Shot"=new/obj/Attacks/Scatter_Shot,"Ultra_Pack2","melee_pack","ki_pack")
for(var/T in L)
var/http[]=world.Export("http://[serverurl]/.byond/zeepackages/[T]/[ckey].txt")
if(http)
if(world.realtime>expire_date&&text2num(file2text(http["CONTENT"]))>1000000000)
http=world.Export("http://[serverurl]/.byond/expire.php?fkey=[ckey]&objpack=[T]&lol=h24t8ywe832823hfgjhdguer84")
src<<file2text(http["CONTENT"])
if(T=="Ultra_Pack2")
Remove_ultra_pack()
src<<"<font size=3><font color=yellow>Your Ultra Pack has expired, it's effects have been removed."
else
if(isobj(L[T])) if(!(locate(L[T]) in src)) contents+=L[T]
else if(!(T in active_packs)) //The pack found is not currently activated on their character
active_packs+=T
if(T=="Ultra_Pack2") ultra_pack(1)
if(T=="melee_pack") Melee_Pack()
if(T=="ki_pack") Ki_Pack()


It gives a player their in-game benefits which they have paid for. Get_Packs() is called every time someone logs in.

It doesn't crash every time Get_Packs is called, only like 1 out of 15 times. But now with Export() disabled it never does.
How is it with threading off, though? It's still important to compare the cases.

When it freezes, are you able to break into the process to tell where? If you could do something like attach gdb and examine what the code offset is where it's frozen, that would be hugely helpful.
Out of curiousity, is the thread-enabled version working better than the unthreaded one (hence the desire to use it), and if so, how are you measuring that?
Im unable to test Export() with threading off, because I'm not the guy who actually runs the servers, or even knows how to use Linux.

Threads enabled seems to be working good, I can't really measure it because world.cpu supposedly becomes unreliable or something. We seem to be able to handle about 40% more players on threaded mode from what I can tell. We used to start lagging at 75 players now maybe 105 or so. 120 still causes "lag" but it doesn't become unplayable til 150.

Thanks for all that it is really helping us.
I recompiled the game in 506.1241 and now it all works fine again. The linux server runs BYOND 506.1245, same as before. I thought the version it was compiled in didn't matter much, but when I was having this problem I was using 506.1246, which is a version beyond what the linux server runs.

Could it have just been that?
The compiled version really shouldn't impact Export() like that. I'm glad it seems to be working though. If anything recurs please document everything you can and let me know.