Author Topic: Proper System Shutdown for maintenance  (Read 1927 times)

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Proper System Shutdown for maintenance
« on: October 21, 2014, 02:13:27 am »
Hi,

I did run a Verify+ this weekend (19/10 at 22:00). 
I didn't get any notification (by email) with the outcomes of that operation, as usually.
So, I went this morning into the web UI to check manually the status of the task.

Once the UI started, the task appeared first as still running.
But when I clicked on it to get the details, it was updated and appeared finally as failed.
So, I clicked again on it but got then the message "No further information is available for the selected task!".


I found in the FlexRAID.nzfs.log that the service eventually restarted:

[2014-10-20 03:33:36.351539][9256]      [OnCloseFile] => Exited...
[2014-10-20 03:37:16.265488][2364]
[2014-10-20 03:37:16.265490][2364]
[2014-10-20 03:37:16.265490][2364]=======================================================================
[2014-10-20 03:37:16.265490][2364]|||||||||||||||||||||   NZFS Service Start ||||||||||||||||||||||||||||
[2014-10-20 03:37:16.265491][2364]=======================================================================

I found the reason in the eventlogs: Windows restarted after some update:
20-10-14 03:17:41: Installation Successful: Windows successfully installed the following update: Windows Malicious Software Removal Tool for Windows 8, 8.1 and Windows Server 2012, 2012 R2 x64 Edition - October 2014 (KB890830)
20-10-14 03:21:16: Installation Successful: Windows successfully installed the following update: Windows Malicious Software Removal Tool for Windows 8, 8.1 and Windows Server 2012, 2012 R2 x64 Edition - October 2014 (KB890830)
20-10-14 03:23:31: Restart Required: To complete the installation of the following updates, the computer will be restarted within 15 minutes:
- Security Update for Windows Server 2012 (KB3000869)
- Security Update for Windows Server 2012 (KB3000061)
- Security Update for Microsoft .NET Framework 4.5, 4.5.1 and 4.5.2 on Windows 8 and Windows Server 2012 x64 (KB2979577)
- Update for Windows Server 2012 (KB2984005)
- Security Update for Microsoft .NET Framework 3.5 on Windows 8 and Windows Server 2012 for x64-based Systems (KB2972101)
- Security Update for Windows Server 2012 (KB2973501)
- Windows Malicious Software Removal Tool for Windows 8, 8.1 and Windows Server 2012, 2012 R2 x64 Edition - October 2014 (KB890830)
- Security Update for Windows Server 2012 (KB2977292)
- Cumulative Security Update for Internet Explorer 10 for Windows Server 2012 (KB2987107)
- Security Update for Microsoft .NET Framework 4.5, 4.5.1 and 4.5.2 on Windows 8 and Windows Server 2012 x64 (KB2978042)
- Security Update for Microsoft .NET Framework 3.5 on Windows 8 and Windows Server 2012 for x64-based Systems (KB2979571)
- Update for Windows Server 2012 (KB3000988)
- Security Update for Internet Explorer Flash Player for Windows Server 2012 (KB3001237)
- Update for Windows Server 2012 (KB2975331)
- Security Update for Microsoft .NET Framework 3.5 on Windows 8 and Windows Server 2012 for x64-based Systems (KB2968295)

20-10-14 03:33:26: The process C:\Windows\system32\svchost.exe (ZEUS) has initiated the restart of computer ZEUS on behalf of user NT AUTHORITY\SYSTEM for the following reason: Operating System: Recovery (Planned)
 Reason Code: 0x80020002
 Shutdown Type: restart

This explains why the task didn't complete and is now in this state.

When Windows Shutdowns, it alerts all the services... Isn't it possible to handle this notification to properly abort the current tasks ? (Or even better, "pause" the current tasks...)
I see indeed an event log entries from NZFS Web Client Service:
20-10-14 03:33:40: Stopping NZFS Web Client for Shutdown Event
20-10-14 03:33:40: NZFS Web Client, exiting service execution...

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: Proper System Shutdown for maintenance
« Reply #1 on: October 21, 2014, 10:35:04 am »
It is a service dependency issue. The broker cannot rely on the UI for aborting thing on system shutdown. So, it does what it needs to do and the UI tries to figure out what happened on its own.

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Re: Proper System Shutdown for maintenance
« Reply #2 on: October 25, 2014, 04:34:32 am »
The Broker service also receives the notification of the imminent shutdown...
Couldn't a pause/abort be implemented on its side ?
The Web Client would then be able to display a message a bit more explicit...
Or event "continue" the paused tasks.

Or... from your answer, I sounds like only the Web Client service can manage the tasks ?!

V.

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: Proper System Shutdown for maintenance
« Reply #3 on: October 25, 2014, 03:13:06 pm »
The broker does indeed get the event and aborts the operation as there is no need for a pause.
Everything in the broker and kernel module is transient. The Web UI is the only thing maintaining state. So, a pause feature (remembering state) would need to be a UI feature. However, on shutdown, the OS determines which service it kills first. So, it is not possible to force a dependency here.