ID:1336225
 
BYOND Version:499.1201
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 28.0.1500.72
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
I am pretty certain that clicking Stop in DreamDaemon is trying to terminate the world as quickly as possible without allowing world.Del() to finish properly. Is there a safer exit that I'm not understanding here, or is there an issue with this internally?

and I know about this

Reference Said:
To prevent accidental hangs during world/Del() from preventing shutdown, a timeout is applied to any sleeping operations such as sleep, world.Export(), and so on. If the total time slept exceeds the timeout, world/Del() is aborted. Currently, this timeout is set at 30 seconds.

and I'm also pretty certain its not that (because it aborts prior to 30 seconds).

Edit:
Upon further investigation, it happens to procs that have "Set background = 1". If you have a complex save routine that is only called in world.Del(), I think it should be safe to hog the world.cpu and ignore background setting (this is the desired functionality, I believe).

Also, if I remove the background setting to force it to work, it takes way longer for Daemon to execute my "SaveWorld" than it does for single-thread seeker/server situation when I click Stop in Daemon (vs closing seeker in the latter situation). Not sure why!

Actually, Daemon seems to freeze and crap out after 6 "chunks" whereas the seeker/server will finish the save every time. 6 chunks would be 6 different savefiles, 75,000 total turfs (12500 per chunk) and a variable amount of objs (maybe a few hundred total in this case).

In other words, I have some code that only works when its hosted via seeker/server single thread.
Still no idea how to get saving to work in my example here when hosting with Dream Daemon. Works fine in Seeker, but you can't host a game with seeker via Ubuntu, so I need a fix for this.
I'm looking into this, though I don't think any fix will be in the immediate next release as it'll touch a lot of code I'm already touching quite a bit. DS and DD both use a timer to tell if the world is ready for final shutdown, but it seems DD is treating this a little differently. I see DD is using a wrapper routine for this that might explain the issue.

There's part of this I'm not quite following, which is: Which procs are using set background=1, and why? Generally speaking, you don't need or want that in any routine that's only called at shutdown. If the routine is not called any other time, then taking out set background=1 is absolutely what you should do.
Its because the proc is used both during run-time and at shutdown. But even if I remove the set background = 1 from the function altogether, it still fails to complete at world.Del() in Daemon but manages to complete just fine in Seeker.
If some other operation is pushing it into the background, that would make sense. From what I'm seeing, the way this is done in DD doesn't allow for a callback to finish.
I am glad to send you the code via email as long as you're expecting it. Let me know.
That probably couldn't hurt, if only for testing purposes. It'd be nice to at least confirm the problem. Does this happen reliably, even in a new setup with no saved games, where I could see this happen if I tested?
I'll include reproduce instructions in the project itself. What is the email address you'd like me to send it to?

Thanks.
You can send it to [email protected].