Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008720opensim[REGION] Script Functionspublic2020-06-27 10:202021-10-19 19:40
Reporterdjphil 
Assigned Totampa 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformPCOperating SystemWindowsOperating System Version10
Product Version 
Target VersionFixed in Version 
Summary0008720: [SCRIPT FUNCTION] osRegionRestart does not work
DescriptionosRegionRestart does not work
The simulator turns off correctly but it does not restart, it stays off
Steps To ReproduceSimple test with default script @ http://opensimulator.org/wiki/OsRegionRestart [^]
Additional InformationIn addition it seems that there is a minimum value for the seconds before restarting but this is not indicated in the wiki.

It seems that the minimum value is 15 seconds ...
Can you confirm this so that I can update the wiki on this subject
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineubODE
Script EngineXEngine
EnvironmentUnknown
Mono VersionNone
ViewerFirestorm
Attached Files

- Relationships

-  Notes
(0036554)
piusnoel (reporter)
2020-06-27 11:02

Running the mentioned default script on Ubuntu 20.04 with Mono 6.10.0.104 worked for me. I used OpenSim 0.9.2.0 Yeti Dev d7089bc (Unix/Mono).
(0036555)
tampa (reporter)
2020-06-27 21:54

This does not restart the region, it only unloads it and then loads it back in while the process is still running. Essentially this is like running reload on services rather than fully shutting down the simulator and starting it again. You can, iirc, configure it to do that instead, but once shutdown there is nothing to restart it again, you would need an external system to check and start the simulator again.

It's a rather useless function as the region restart is messy and can cause issues so I would not recommend using this function.

Not to mention what a potentially bad idea it is to place this in a state_enty function... why is there no check against this?
(0036556)
djphil (reporter)
2020-06-28 02:10
edited on: 2020-06-28 02:12

I could not see the region unload ...
With a delay of less than 15 seconds nothing happens
With a delay greater than or equal to 15 seconds, I receive the message to warn that the region will restart and I see the simulator turning off.
Nothing more ...

If the function is not a real restart but a shutdown, then it would seem to me better to rename it correctly osRegionShutdow and not osRegionRestart

If, as you say, it is necessary to use a third-party application to restart the region after using osRegionRestart (which is not a real restart) then it would be good to specify it also on the wiki do not you think?

If I use the console command "restart region", it really restarts the region without completely shutting down the simulator, but this causes many red console alerts about compiling.
"11:06:34 - [Compile]: Exception trying to delete old script file .... etc"
I specify that delete script on startup is on False at home and must remain on False so that some of my scripts work correctly (they cannot lose some uuids).

So from my point of view things are not going well ...

(0036558)
piusnoel (reporter)
2020-06-28 02:51

Today, I've given it a try on my Windows 10 Home on a Standalone installation of OpenSim 0.9.2.0 Yeti Dev 16cfb3d (Win/.NET) with 3 regions and it worked too.

In both cases I've been Estate Owner and among other not directly related things I've set the following line in my osslEnable.ini:
  Allow_osRegionRestart = ESTATE_MANAGER,ESTATE_OWNER

Btw, I agree with all said by tampa.
(0036559)
djphil (reporter)
2020-06-28 02:57
edited on: 2020-06-28 02:59

I'm god on my grid but ...
On my osslDefaultEnable.ini
Allow_osRegionRestart = ESTATE_MANAGER,ESTATE_OWNER
On my osslEnable.ini
Allow_osRegionRestart = ESTATE_MANAGER,ESTATE_OWNER

Please also try with a delay of less than 15 seconds.
Thank you in advance.

PS: I specify that my test is carried out on a simulator in grid mode. I did not try in standalone mode.

(0036561)
piusnoel (reporter)
2020-06-28 03:12
edited on: 2020-06-28 03:20

So far I've tested with delays of 30, 60 and 120 seconds only. Now, I tested again with lower delays. No reaction with a value of 10 seconds, but 15 seconds worked like the others.

I also get these "12:09:51 - [Compiler]: Exception trying delete old script file ..." at the console.

On Linux I've been testing in grid mode too.
On Linux I've seen another issue as well: the message appears too often in the viewer. But that's another issue.

(0036562)
djphil (reporter)
2020-06-28 03:24

This seems to confirm a minimum value for delay ...
I'm waiting for confirmation to modify the wiki accordingly.

For the rest I confirm that, with a delay of 120 seconds (so the default script) my simulator simply turns off and nothing else happens.

This with Windows 10 and Opensim Master in grid mode with 3 regions on a simulator.
(0036563)
djphil (reporter)
2020-06-28 03:36

Ok, I put a small simple standalone (1 region) in place and tested osRegionRestart on it.

It worked fine here too. I received the alert messages and the region has restarted correctly.

The problem therefore seems to concern grid mode or perhaps having several regions on the same simulator, I don't know.

Anyway, there is a problem ...
(0036564)
djphil (reporter)
2020-06-28 03:49

Another point to clarify is also the use of osRegionRestart in conjunction with DeleteScriptsOnStartup = true/false.
This seems mandatory to avoid red compilation error messages when restarting the region.

It remains to be confirmed.
The opensim wiki says nothing about it.
(0036587)
tampa (reporter)
2020-07-09 18:11

This "restart" is more an unloading and loading back in without some cleaning routines that are run during proper shutdown. I would advice against using this method to "refresh" a region on a simulator even if you don't see any red on console.
(0036618)
djphil (reporter)
2020-07-18 15:30

What's going on about this mantis?
Will the problem be solved for grid mode?

And also, can you confirm the minimum delay required and the mandatory joint use of deleteScriptOnStartup on True

Thank you in advance.
(0036620)
BillBlight (developer)
2020-07-18 15:38

Soft restarts have NEVER worked right, it is an issue with .NET/Mono not opensim per say ...

.NET/Mono does not release resources on a soft restart , this can and does cause major issues with OpenSim ..

Despite the fact that this function causes issues, has never worked right, people still seem to want to use it ..

I know Ubit has disabled the console restart command and expect the osRegionRestart to follow suit ...
(0036621)
tampa (reporter)
2020-07-19 00:03

The function in conjunction with an actual shutdown has use however, similarly to the ability to call for a restart from within the viewer itself. As mentioned in the other ticket regarding the issues caused by simply "reloading" the region having something to call for a restart is useful. The only caveat is that it will not restart on its own, how could it, there is nothing "running" to tell it to start up again. This can be achieved on Linux through a service definition or a while loop in bash to test and start what isn't running. On Windows you can setup services as well or simply a scheduled task to a script that checks if running and if not starts it. With that setup you have a way of restarting a simulator without needing to access the server.

This function along with the functionality for the viewer should stay but cause a full simulator shutdown rather than a "reload" of the region.
(0036622)
djphil (reporter)
2020-07-19 01:17
edited on: 2020-07-19 01:18

As I pointed out above, the standalone mode behavior is not the same as in grid mode.
So I imagine that something can be improved for this function in Grid mode.

You did not respond to the delay and the mandatory joint use of deleteScriptOnStartup.

(0036623)
tampa (reporter)
2020-07-19 02:16

It is very likely the delay is just there as a security measure, likely selected at random. I suppose adding this information to the wiki is fine, but it may confuse people thinking it will shutdown in that minimal timeframe which might not happen if the region has to commit a lot of data to disk.

deleteScriptonstartup is only needed if you were to do "reloading" rather than restarting, because if you deleted all script data each restart it would take a lot longer to do reboots and some scripts would not startup at all. It is a setting for debugging more so than trying to get this "reloading" to work, which did not even work flawlessly when it was introduced, heck I would go as far as saying that adding regions to an already running simulator is not the best option and should be followed by a restart.

I would guess the function exists to complete the suite of management functions or to make it as easy as touching a prim to issue a restart, but I doubt it sees that much use as is, especially since region owners can use the viewer directly to issue a restart and you normally don't need to restart a simulator all that often unless you happen to have hundreds of people coming through each day, especially with gc and memory footprint being less of an issue.

Add to the wiki that it makes the most sense to use the viewer shutdown function along with:

    ;# {InworldRestartShutsDown} {} {Shutdown instance on region restart?} {true false} false
    ;; If you have only one region in an instance, or to avoid the many bugs
    ;; that you can trigger in modules by restarting a region, set this to
    ;; true to make the entire instance exit instead of restarting the region.
    ;; This is meant to be used on systems where some external system like
    ;; Monit will restart any instance that exits, thereby making the shutdown
    ;; into a restart.
     InworldRestartShutsDown = true

That pretty much says all you need to know anyways. "Reloads" cause issues, do clean shutdowns and starts of the entire simulator instead, this function is only there to make it easier or if you want to give others the power to call for a restart.
(0036624)
Luisillo_Contepomi (reporter)
2020-07-19 02:49

@djphil please see the same issue in http://opensimulator.org/mantis/view.php?id=8728 [^]

It is strange but for me this means that "OsRegionRestart" or restart from viewer utility no longer exists. Regarding the wiki, I think that you could remove the references that indicate their existence.
(0038051)
tampa (reporter)
2021-10-19 19:40

Region restarts or rather region unloading-reloading is not advisable and pretty much phased out now. If you want restarts then switch to full shutdown and use either scheduled tasks(windows) or cronjob(linux) to start OpenSim back up. That ends up the better method.

There are some restrictions on these functions and the estate functionality for a reason given you don't want just anybody restarting things while you are doing something. In general you want that to happen intentionally so support for this through inworld script or buttons is really something that only exists for convenience. Don't break your regions folks :)

- Issue History
Date Modified Username Field Change
2020-06-27 10:20 djphil New Issue
2020-06-27 11:02 piusnoel Note Added: 0036554
2020-06-27 21:54 tampa Note Added: 0036555
2020-06-28 02:10 djphil Note Added: 0036556
2020-06-28 02:12 djphil Note Edited: 0036556 View Revisions
2020-06-28 02:51 piusnoel Note Added: 0036558
2020-06-28 02:57 djphil Note Added: 0036559
2020-06-28 02:59 djphil Note Edited: 0036559 View Revisions
2020-06-28 02:59 djphil Note Edited: 0036559 View Revisions
2020-06-28 03:12 piusnoel Note Added: 0036561
2020-06-28 03:20 piusnoel Note Edited: 0036561 View Revisions
2020-06-28 03:24 djphil Note Added: 0036562
2020-06-28 03:36 djphil Note Added: 0036563
2020-06-28 03:49 djphil Note Added: 0036564
2020-07-09 18:11 tampa Note Added: 0036587
2020-07-18 15:30 djphil Note Added: 0036618
2020-07-18 15:38 BillBlight Note Added: 0036620
2020-07-19 00:03 tampa Note Added: 0036621
2020-07-19 01:17 djphil Note Added: 0036622
2020-07-19 01:18 djphil Note Edited: 0036622 View Revisions
2020-07-19 02:16 tampa Note Added: 0036623
2020-07-19 02:49 Luisillo_Contepomi Note Added: 0036624
2021-10-19 19:40 tampa Note Added: 0038051
2021-10-19 19:40 tampa Status new => resolved
2021-10-19 19:40 tampa Resolution open => no change required
2021-10-19 19:40 tampa Assigned To => tampa


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker