Bug #78
Updated by Lionel Martin about 12 years ago
It seems that the tasks are started too early on application start, except at server startup.
h2. Configuration
I have setup the following on my TEST application to get the trace :
- In init.nvp, add command 'NV_CMD=|MISC:SLEEP| TIME=|20000|' to have a init.nvp that lasts 20 seconds.
- Add a task (perl:Test/test_20121102[PROC='task']), repeating every 30 seconds : ie daily, during 23:59:59, repeat mode to YES, every 30 seconds, occurences to 0
- Add a listener (perl:Test/test_20121102[PROC='listener']), repeating every 30 seconds (30000 milliseconds).
Procedure perl:Test/test_20121102 only contains the command 'NV_CMD=|MISC:SLEEP| TIME=|5000|' to sleep 5 seconds.
h2. Result at server startup
Here is an extract of the server startup trace :
<pre>
Starting @Starting applications...
13:59:42 8A18BA4ED1 NVDEF --- Start procedure: init
13:59:42 8A18BA4ED1 NVDEF --- End procedure: init (0.00 s)
13:59:42 2A66C3EDC8 TEST --- Start procedure: init
14:00:02 2A66C3EDC8 TEST SYSTEM:MISC:SLEEP (20.00 s)
14:00:02 2A66C3EDC8 TEST --- End procedure: init (20.00 s)
Starting HTTP server on port 1081 ...
Starting HTTPS server on port 1082 ...
Starting scheduler...
Starting listeners...
NIRVA server ready
14:00:02 7EDC32DB29 TEST --- Start procedure: perl:Test/test_20121102[PROC='listener']
14:00:02 B13A063145 TEST --- Start procedure: perl:Test/test_20121102[PROC='task']
14:00:07 7EDC32DB29 TEST SYSTEM:MISC:SLEEP (5.00 s)
14:00:07 7EDC32DB29 TEST --- End procedure: perl:Test/test_20121102[PROC='listener'] (5.00 s)
14:00:07 7EDC32DB29 TEST SYSTEM:MISC:NOP (0.00 s)
14:00:07 B13A063145 TEST SYSTEM:MISC:SLEEP (5.00 s)
14:00:07 B13A063145 TEST --- End procedure: perl:Test/test_20121102[PROC='task'] (5.00 s)
14:00:07 B13A063145 TEST SYSTEM:MISC:NOP (0.00 s)
</pre> @
Everything is alright, listener and task are started after the server startup.
h2. Result when server up, at application start
We stop the application in the nirva configuration tool, and then restart it (after a while to be sure tasks and listeners will be triggered as soon as possible).
Here is an extract of the trace :
<pre>
14:00:25 @14:00:25 342330E908 NVDEF SYSTEM:APPLICATION:STOP (1.12 s)
14:04:09 8A4672AA2B TEST --- Start procedure: init
14:04:10 C21B2A5258 TEST --- Start procedure: perl:Test/test_20121102[PROC='task']
14:04:15 C21B2A5258 TEST SYSTEM:MISC:SLEEP (5.00 s)
14:04:15 C21B2A5258 TEST --- End procedure: perl:Test/test_20121102[PROC='task'] (5.00 s)
14:04:15 C21B2A5258 TEST SYSTEM:MISC:NOP (0.00 s)
14:04:29 8A4672AA2B TEST SYSTEM:MISC:SLEEP (20.00 s)
14:04:29 8A4672AA2B TEST --- End procedure: init (20.00 s)
14:04:29 342330E908 NVDEF --- Start procedure: (Config/system_application_list)
14:04:29 342330E908 NVDEF SYSTEM:CONTAINER:REMOVE (0.00 s)
14:04:29 F1B5DA1F6B TEST --- Start procedure: perl:Test/test_20121102[PROC='listener']
14:04:29 342330E908 NVDEF SYSTEM:APPLICATION:INFO (0.01 s)
14:04:29 342330E908 NVDEF SYSTEM:OBJECT:TABLE_SORT (0.00 s)
14:04:29 342330E908 NVDEF --- End procedure: (Config/system_application_list) (0.00 s)
14:04:29 342330E908 NVDEF SYSTEM:APPLICATION:START (20.04 s)
14:04:34 F1B5DA1F6B TEST SYSTEM:MISC:SLEEP (5.00 s)
14:04:34 F1B5DA1F6B TEST --- End procedure: perl:Test/test_20121102[PROC='listener'] (5.00 s)
14:04:34 F1B5DA1F6B TEST SYSTEM:MISC:NOP (0.00 s)
</pre> @
The listener is correctly started after the end of init procedure, but the task is started right after init procedure started.
h2. Configuration
I have setup the following on my TEST application to get the trace :
- In init.nvp, add command 'NV_CMD=|MISC:SLEEP| TIME=|20000|' to have a init.nvp that lasts 20 seconds.
- Add a task (perl:Test/test_20121102[PROC='task']), repeating every 30 seconds : ie daily, during 23:59:59, repeat mode to YES, every 30 seconds, occurences to 0
- Add a listener (perl:Test/test_20121102[PROC='listener']), repeating every 30 seconds (30000 milliseconds).
Procedure perl:Test/test_20121102 only contains the command 'NV_CMD=|MISC:SLEEP| TIME=|5000|' to sleep 5 seconds.
h2. Result at server startup
Here is an extract of the server startup trace :
<pre>
Starting @Starting applications...
13:59:42 8A18BA4ED1 NVDEF --- Start procedure: init
13:59:42 8A18BA4ED1 NVDEF --- End procedure: init (0.00 s)
13:59:42 2A66C3EDC8 TEST --- Start procedure: init
14:00:02 2A66C3EDC8 TEST SYSTEM:MISC:SLEEP (20.00 s)
14:00:02 2A66C3EDC8 TEST --- End procedure: init (20.00 s)
Starting HTTP server on port 1081 ...
Starting HTTPS server on port 1082 ...
Starting scheduler...
Starting listeners...
NIRVA server ready
14:00:02 7EDC32DB29 TEST --- Start procedure: perl:Test/test_20121102[PROC='listener']
14:00:02 B13A063145 TEST --- Start procedure: perl:Test/test_20121102[PROC='task']
14:00:07 7EDC32DB29 TEST SYSTEM:MISC:SLEEP (5.00 s)
14:00:07 7EDC32DB29 TEST --- End procedure: perl:Test/test_20121102[PROC='listener'] (5.00 s)
14:00:07 7EDC32DB29 TEST SYSTEM:MISC:NOP (0.00 s)
14:00:07 B13A063145 TEST SYSTEM:MISC:SLEEP (5.00 s)
14:00:07 B13A063145 TEST --- End procedure: perl:Test/test_20121102[PROC='task'] (5.00 s)
14:00:07 B13A063145 TEST SYSTEM:MISC:NOP (0.00 s)
</pre> @
Everything is alright, listener and task are started after the server startup.
h2. Result when server up, at application start
We stop the application in the nirva configuration tool, and then restart it (after a while to be sure tasks and listeners will be triggered as soon as possible).
Here is an extract of the trace :
<pre>
14:00:25 @14:00:25 342330E908 NVDEF SYSTEM:APPLICATION:STOP (1.12 s)
14:04:09 8A4672AA2B TEST --- Start procedure: init
14:04:10 C21B2A5258 TEST --- Start procedure: perl:Test/test_20121102[PROC='task']
14:04:15 C21B2A5258 TEST SYSTEM:MISC:SLEEP (5.00 s)
14:04:15 C21B2A5258 TEST --- End procedure: perl:Test/test_20121102[PROC='task'] (5.00 s)
14:04:15 C21B2A5258 TEST SYSTEM:MISC:NOP (0.00 s)
14:04:29 8A4672AA2B TEST SYSTEM:MISC:SLEEP (20.00 s)
14:04:29 8A4672AA2B TEST --- End procedure: init (20.00 s)
14:04:29 342330E908 NVDEF --- Start procedure: (Config/system_application_list)
14:04:29 342330E908 NVDEF SYSTEM:CONTAINER:REMOVE (0.00 s)
14:04:29 F1B5DA1F6B TEST --- Start procedure: perl:Test/test_20121102[PROC='listener']
14:04:29 342330E908 NVDEF SYSTEM:APPLICATION:INFO (0.01 s)
14:04:29 342330E908 NVDEF SYSTEM:OBJECT:TABLE_SORT (0.00 s)
14:04:29 342330E908 NVDEF --- End procedure: (Config/system_application_list) (0.00 s)
14:04:29 342330E908 NVDEF SYSTEM:APPLICATION:START (20.04 s)
14:04:34 F1B5DA1F6B TEST SYSTEM:MISC:SLEEP (5.00 s)
14:04:34 F1B5DA1F6B TEST --- End procedure: perl:Test/test_20121102[PROC='listener'] (5.00 s)
14:04:34 F1B5DA1F6B TEST SYSTEM:MISC:NOP (0.00 s)
</pre> @
The listener is correctly started after the end of init procedure, but the task is started right after init procedure started.