Caveat: I'm not a programmer, or an expert, but I've made some educated guesses. Also I can't spend forever trying to understand the problem.
Okay, it isn't your NAS that is your problem, it is your Sonos devices. You seem to have six separate Sonos devices. When MC tries to shutdown, I believe that it is trying to tell the Sonos devices that it is shutting down, or something like that. MC doesn't seem to be getting a response. I took a look at the "Previous Log.txt" log you posted, and I can see the shutdown start with the command: "0016907: 10656: General: CMCToolsCore::StopTools: Start". The shutdown does a few things for a very short time, and then you start to get a whole lot of log records similar to:
0019391: 8996: Sharing Plugins: CHTTPListenerWorker::HandleConnection: Start
0019391: 8996: Sharing Plugins: CHTTPListenerWorker::HandleRequest: UDP: 192.168.1.1: NOTIFY:
http://239.255.255.250:1900*
0019391: 8996: Sharing Plugins: CSSDPWorker::ProcessNotify: ssdp:alive: uuid:b17b91a3-e5bb-46da-a2f4-dcd0e9e2da03::upnp:rootdevice
0019391: 8996: Sharing Plugins: CHTTPListenerWorker::HandleConnection: Finish (0 ms)
That is MC trying to talk to UPnP/DLNA devices on IP Address 239.255.255.250, which is a Unicast/Multicast address for talking to such devices, according to this:
HOST: 239.255.255.250:1900. MAN: ssdp:discover. MX: 10. ST: ssdp:all. All other UPnP devices or programs are required to respond to this message by sending a similar message back to the device, using a UDP unicast, announcing which UPnP profiles the device or program implements.It could be that your Sonos devices are misconfigured, or that a firewall is interfering with the communication. Has anything changed on your LAN that may have caused this problem?
I did notice that you let MC try to close for about 50 seconds and then killed it, and wondered if it would have eventually closed correctly if left alone, but then I remembered you had said;
I have, in fact, let MC run all night after I tried to close it, but it did not close.
So, it isn't going to close. If you tried that again with logging turned on, you would probably see a whole lot more of the Sharing Plugins/SSDP messages.
So, what to do?
1. Turn off all your Sonos equipment, reboot your MC PC, play some music to some other zone, since the Sonos won't be available, and then try to close MC.
Did that work? It should, but it still may not, as MC may try to find the Sonos devices it knows about. But if that does work consistently, then you know the problem is to do with your Sonos devices. If it doesn't work, run a log again and look for the above log records. In particular, see if MC is sending any messages to the IP Address 239.255.255.250, as that would indicate it is still trying to talk to UPnP/DLNA devices.
2. The above may highlight the cause of the issue, but how to fix it? Trying turning off
all Firewalls on all devices in your LAN, if you can.
That shouldn't be hard on the MC PC, but I don't know about the Sonos devices. Also, you should make sure that your router trusts all local traffic. You may be able to check logs in your router to see if it is blocking traffic to the address 239.255.255.250, as many routers do block traffic to broadcast addresses by default. There are a bunch of threads on Sonos devices, and I see you have contributed to some. Maybe AndrewFG's tool can help isolate the problem, or maybe Andrew himself will have some ideas.
If turning off the firewalls fixes the problem, then I would guess that you need to change some firewall rules.
3. Another thought. Do you stop all playback before closing MC?
It could be that because MC is playing something to the Sonos devices, it is trying to tell the devices to stop, or something. Just confirm if a shutdown works with nothing playing. There was a change in MC21.0.10 (9/24/2015), "19: Fixed: DLNA: MC's renderer was posting the wrong STOP command which was causing a long delay eventing the STOP when the Audio setting for STOP was FADEOUT" but it doesn't look like it should have broken your previously working system. But maybe something else got changed at the same time.
Another caveat: If the log you posted above was created soon after starting MC, all the above could be completely wrong.
The correct technique for collecting a log with your problem would be to;
a. Start MC and leave it running for at least a few minutes so that all start-up processes are complete.
b. Play a little music on MC, via the Sonos devices, then stop playback.
c. Turn on logging, clear the log.
d. Attempt to close MC. Leave it trying to close for five minutes, then kill it if it hasn't closed.
e. Restart MC and immediately save the log, and post it back here.
See how you go with the above.