Jump to content

Can I detect when a sim restart is imminent?


Tenaar Feiri
 Share

You are about to reply to a thread that has been inactive for 1010 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hey! The title pretty much asks my question for me, but I'll just go ahead & repeat it here.

 

Can I detect when a sim is *about* to be restarted using LSL? I'm working on a script that deals with some data & saves it to the object description and an invisible llSetText() to make it easier to have it persist through restarts & such.

The script saves the data periodically, but I don't want to accidentally lose any of the information it's currently processing if a restart unexpectedly happens in the middle of its workflow. I know scripts generally just 'pause' when the server's down & resume again afterwards but I don't trust LL's servers to reliably retain my script data.

Is there a way my script can notice when the server's going to be restarted or brought down, so it can stop its work & save the data so it can safely resume its operation afterwards?

Link to comment
Share on other sites

Right, there's no such notification to scripts. I'm not sure it would be very useful anyway, especially not for the reason suggested:


 I know scripts generally just 'pause' when the server's down & resume again afterwards but I don't trust LL's servers to reliably retain my script data.

Such data must be stored externally to SL. Storing it in atttributes of an object on a sim is no more reliable than just trusting the script to start again gracefully (and if they differed, I'd trust the script's state more than the object's).

If you're recording stuff of significance outside the sim (e.g., financial transactions), then yeah, those need to be stored externally. One reason is that the sim may not restart at the point where it left off; i.e., it may be rolled-back to a previously saved state. As far as the scripts and objects on the sim, everything is internally consistent, but as if a chunk of history never happened.

  • Like 1
Link to comment
Share on other sites

That makes sense. The data's not important enough to justify sending it to my ext. server, but at least I know it's not possible to anticipate the restarts!

It's a shame we can't trust the object attributes, really. Or the script memory for that matter; I've had scripts randomly reset themselves whenever someone logs in wearing it, without there being a single reset call in the code to begin with, so I learned not to trust that the hard way.

 

In any case, thanks for answering! Appreciate it!

Link to comment
Share on other sites


steph Arnott wrote:


Drake1 Nightfire wrote:

Yes, there is a little blue box that drops down and says "RUN LIKE HELL!!! SIM RESTART IN 5 MINUTES!!"

The OP said "Can I detect when a sim is *about* to be restarted using LSL?"

Who crapped in your Cheerios his morning? Don't know a joke when you see one? Lighten up.

Link to comment
Share on other sites

Only avatars get the warning message not objects.

So the answer is no.

You could use a bot.

Question is: why?

After restart everything is running like b4 the restart. If the server gets a new version there is a rollback between the last backup and the shutdown. A monitor I run showed me in the last year times between a few mins and 2 hours (very rare).

So whatever you do, you cant save any information in the sim for the last few minutes. That will be wiped out in a timewarp. :D You need to save any late data on an external server.

Link to comment
Share on other sites


Tenaar Feiri wrote:

...

The script saves the data periodically, but I don't want to accidentally lose any of the information it's currently processing if a restart unexpectedly happens in the middle of its workflow. I know scripts generally just 'pause' when the server's down & resume again afterwards but I don't trust LL's servers to reliably retain my script data.

...

I feel you're overlooking the fact that you're trusting the server to pause and resume script execution up to 45 times a second any time the server is going. A script gets a very thin slice of a server frame. And between those slices, they're rolled up like a rug and stashed in a corner. And let's not even get into the hand off that occurs when teleporting to another sim, when you may have to be trusting not only two different servers, but they may be running differing channels of the software...

Link to comment
Share on other sites

  • 3 years later...

Here's a scenario where this would be useful: 

I run a sim where people like to stay locked up by RLV. Some like to go to bed and wake up still locked up. If the sim shuts down, they are logged off. If an imminent shim shutdown could be detected, and RLV device could force-teleport to another region. Then it would periodically to see if the sim was back, and then teleport back to it. 

The sim knows that shutdown is imminent. Some kind of message that scripts could listen to and have a minute to respond to would be useful for this. 

Link to comment
Share on other sites

Neverminding the necroposting, to be blunt, LL isn't going to implement this feature until they do something definitive against no-copy object duplication means. Specifically, remove any trace of rezzed no-copy object data from all sim state saves when said object is deleted, taken/returned to inventory, attached from ground, moved to another region or if the object has an owner change while rezzed, update all sim state save data with the change.

Once that deterrent is in place, maybe the llGetEnv() "region_stop_time" as well as the llGetObjectDetails() OBJECT_REZ_TIME constants can finally be implemented.

https://jira.secondlife.com/browse/BUG-8426

https://jira.secondlife.com/browse/BUG-9666

  • Like 1
Link to comment
Share on other sites

  • 3 years later...
On 8/3/2021 at 7:27 PM, Quistess Alpha said:

I'll bite. Usually when a sim shuts down all the viewers put up a blairing warning. It should be possible for the viewer to then relay the warning on a known channel for things to listen to. . .

Yes, when the user is online... How would it work when the user is not online though?

Link to comment
Share on other sites

1 minute ago, OptimoMaximo said:

Yes, when the user is online... How would it work when the user is not online though?

It wouldn't. Even so, that might be enough for /some/ use-cases (like the people who like to remain online while AFK)

Link to comment
Share on other sites

  • 2 weeks later...
12 hours ago, Gayngel said:

You can write a check for a sim restart with llRequestSimulatorData before storing your data or processing it: http://wiki.secondlife.com/wiki/LlRequestSimulatorData

There is a "stopping" value returned when calling DATA_SIM_STATUS which will tell you if a region is about to stop/shutdown/restart.

OP is talking about detecting the countdown phase, which only happens when there are main agents present, not detecting remotely.

llRequestSimulatorData() can't detect that countdown mode. It will still show 'up' status during that time.

During 'stopping' all agents in the region have already been disconnected and no scripts are running.

Link to comment
Share on other sites

48 minutes ago, Lucia Nightfire said:

OP is talking about detecting the countdown phase, which only happens when there are main agents present, not detecting remotely.

llRequestSimulatorData() can't detect that countdown mode. It will still show 'up' status during that time.

During 'stopping' all agents in the region have already been disconnected and no scripts are running.

The OP is from 7 bloody years ago... 

  • Like 3
Link to comment
Share on other sites

13 hours ago, Gayngel said:

You can write a check for a sim restart with llRequestSimulatorData before storing your data or processing it: http://wiki.secondlife.com/wiki/LlRequestSimulatorData

There is a "stopping" value returned when calling DATA_SIM_STATUS which will tell you if a region is about to stop/shutdown/restart.

Is there record* of scripts seeing this return value? If so, do we know the timing relative to shutdown warning to avatars?

______________
*a record presumably stored outside the region

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1010 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...