U4-5121 - umbraco.content launches threadpool threads to reload the xml cache which causes lots of other issues

Created by Shannon Deminick 23 Jun 2014, 01:57:44 Updated by Sebastiaan Janssen 11 Jul 2014, 07:05:49

Original title: Publishing from within an IPackageAction fails

Original description: If you try to publish documents from within an IPackageAction it doesn't quite work. The publishing works but in many cases it doesn't make it into the xml cache - i think it's because the app gets restarted perhaps before the xml is written.

Updated description:

If i install a package that does some publishing in an IPackageAction, all of the code fires and things are published in the database (the contentXml table is written to). Then the installer decides to call the dreaded:


which eventually calls: content.Instance.RefreshContentFromDatabaseAsync();

This runs on a threadpool thread, so while this attempts to start executing (whenever it feels like it wants to), at the end of the current request we also call:


because we know there's queued changes.

Then... the app pool restarts. So the first thing to note is that the threadpool thread will just get destroyed while in the middle of whatever it is doing, if it's even started yet.

As you can see, trying to debug this is ultra difficult and I have a good feeling this is the cause for many of those Umbraco oddities.


Sebastiaan Janssen 11 Jul 2014, 07:05:49

Fixed in revs: 859fbaaa058794dd67d1f09f1902146556b275ce (v6) and 5fdcec6904dd018f8d37dad67f243f667f49f06e (v7)

Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.1.5, 6.2.2


Story Points: