Issue with UpdateDocumentCache causing site to be inaccessible.
Hi,
As I mentioned in my previous thread my company has created a website with an update process. This updater process will retrieve some XML from the database. The updater routine will then cycle through each item returned in the XML and update the correct Umbraco node. It will then mark the node to be published and then call UpdateDocumentCache to cause the update to occur. It would of course be more ideal to wait until every node has been updated with new data then call UpdateDocumentCache. Unfortunately this causes issues as Umbraco seems to get out of sync and it causes all sorts of issues. The side affect of doing it this way the site becomes unavailable during the update process (Can take 10+ minutes). This is obviously unacceptable for a live site.We guessed that the cause of this was that because we call UpdateDocumentCache it causes the site to become unavailable whilst it does this update.However this is happening several times a second rendering the site inaccessible for the duration.To test this we added a Thread.Sleep(100), which causes the thread to sleep for 100miliseconds between updates.The theory was that this would allow Umbraco a chance to serve pages in these periods.It did indeed “solve” the problem.This, however, is a very inelegant solution.
I have a few questions about this.
Is this a problem with Umbraco or is this a designed feature?
Is it a commonly known problem? (I did a bit of Googling but came up with nothing of note)
Is there a setting somewhere that can control this behavior.
Is there a better solution than using a Thread.Sleep(100) in order to give Umbraco a chance to serve pages during the update process.
Any and all information on this would be much appreciated.
I have added the line; <cloneXmlContent>True</cloneXmlContent> to the Config\UmbracoSettings.Config document under <settings> <content>. This seems to have reduced the problem some what.
I looked at the source code which indicated this setting was being checked. It will then create a deep copy of the XML Document and publish that rather than republish the actual copy. I'm guessing this works as it means that actual copy is still available whilst the new copy is being re-published. The problem does not seem to have gone away completely though so any other advise on this would be awesome.
Issue with UpdateDocumentCache causing site to be inaccessible.
Hi,
As I mentioned in my previous thread my company has created a website with an update process. This updater process will retrieve some XML from the database. The updater routine will then cycle through each item returned in the XML and update the correct Umbraco node. It will then mark the node to be published and then call UpdateDocumentCache to cause the update to occur. It would of course be more ideal to wait until every node has been updated with new data then call UpdateDocumentCache. Unfortunately this causes issues as Umbraco seems to get out of sync and it causes all sorts of issues. The side affect of doing it this way the site becomes unavailable during the update process (Can take 10+ minutes). This is obviously unacceptable for a live site. We guessed that the cause of this was that because we call UpdateDocumentCache it causes the site to become unavailable whilst it does this update. However this is happening several times a second rendering the site inaccessible for the duration. To test this we added a Thread.Sleep(100), which causes the thread to sleep for 100miliseconds between updates. The theory was that this would allow Umbraco a chance to serve pages in these periods. It did indeed “solve” the problem. This, however, is a very inelegant solution.
I have a few questions about this.
Is this a problem with Umbraco or is this a designed feature?
Is it a commonly known problem? (I did a bit of Googling but came up with nothing of note)
Is there a setting somewhere that can control this behavior.
Is there a better solution than using a Thread.Sleep(100) in order to give Umbraco a chance to serve pages during the update process.
Any and all information on this would be much appreciated.
Kind regards,
Pete.
Just an update on this one.
I have added the line; <cloneXmlContent>True</cloneXmlContent> to the Config\UmbracoSettings.Config document under <settings> <content>. This seems to have reduced the problem some what.
I looked at the source code which indicated this setting was being checked. It will then create a deep copy of the XML Document and publish that rather than republish the actual copy. I'm guessing this works as it means that actual copy is still available whilst the new copy is being re-published. The problem does not seem to have gone away completely though so any other advise on this would be awesome.
Thanks,
Peter.
is working on a reply...