Reproduced on 17.10.13 (jetty-hsqldb distribution). The stale CSS shows up when the SSX is saved while it is being loaded by other requests. It does not happen on a plain edit with no concurrent load.
Steps
Generate a LESS stylesheet large enough to take about 1.5 s to compile:
Create the page LessRepro.Race with an XWiki.StyleSheetExtension object: Content Type LESS, Use this extension On this page or on demand, Code = the content of ssx.less. Save.
Load /xwiki/bin/ssx/LessRepro/Race?language=en&k=0 and check that it contains color:red.
Start 3 parallel loaders on the SSX. The k parameter only gives each loader its own URL:
rm -f /tmp/stop
for k in 0 1 2; do
(while [ ! -f /tmp/stop ]; do
curl -s -u Admin:admin -o /dev/null"http://localhost:8080/xwiki/bin/ssx/LessRepro/Race?language=en&k=$k" done) &
done
While the loaders run, edit the object, replace color: red with color: blue and save.
Wait about 2 seconds, then stop the loaders: touch /tmp/stop
Check what each URL serves:
for k in 0 1 2; do
curl -s -u Admin:admin "http://localhost:8080/xwiki/bin/ssx/LessRepro/Race?language=en&k=$k" | grep -o 'color:[a-z]*' | head -1
done
Result
Expected: every URL serves color:blue. Actual: some URLs keep serving color:red, although the saved object contains color: blue.
Saving the document again does not always fix it. In one run, one URL kept serving an old color through 11 later saves, including a save made with no concurrent load, while the other URLs served the new color each time.
It does not happen on every attempt: between 2 and 6 out of 10 saves left stale CSS in my runs. Repeat steps 4 to 7 (alternating the color) if the first attempt serves the new CSS everywhere. A smaller stylesheet makes the problem much rarer.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.