As a result of my issues with my 2nd media drive in a related thread
, I got to looking at the StorageDevices_StatusRadar.sh script and I have a question-
Regarding the use of the CacheSet and CacheGet function. I see that this is used to "remember" the online flag of a storage device, the last time the script polled the devices. This makes sense because it means that the script doesn't have to query the database every time to get this value... it only has to do that the first time the script polls and there is no stored value.
However, where this logic appears to fall down is that the script will often be running on more than one machine on the LMCE network (all mediadirectors and the core) and since the scripts don't share the cached value(s), they can't know if another script has changed the flag or not because they never re-check the database. This is exactly what happened in my case- When the core started the StorageDevices_StatusRadar script, my media drive was (correctly) marked online as a local, mountable drive. The value was cached and as far as the core instance of the script was concerned it stayed that way.
Then when a media director started up, it ran the same script locally, but this time it determined that the media drive was not online because it couldn't access the samba share (another issue
) so it marked the device as offline in the database.
So now there was a situation where the two scripts carried on merrily "polling" every few seconds and remembering the status of the same device differently. I'm not even sure which was right in the end because, granted, the samba share wasn't available, but the drive was still accessible-> I could still *play* the videos... I just couldn't see them in the datagrid, so as far as I was concerned it was online.
1. "Should" the media director consider the media drive to be offline if it can't access it as a samba share?
2. Does it make sense that the script runs on each machine and "remembers" a flag for the same device that is not shared between them? What are the alternatives?
Any thoughts/ comments?