Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.0
-
None
-
XWiki 14.2.1
-
Unknown
-
Description
If I use the following code, everything looks fine:
{{job id="test" start="{{velocity~}~}$!{request.confirm}{{/velocity~}~}"}}
{{groovy}}
import org.xwiki.logging.LogLevel;
def log = services.logging.getLogger(doc.fullName)
services.logging.setLevel(doc.fullName, LogLevel.INFO);
services.progress.pushLevel(5);
for (int i = 0; i < 5; i++) {
services.progress.startStep();
log.info('Step {}', i);
sleep(1000);
services.progress.endStep();
}
services.progress.popLevel();
{{/groovy}}
{{/job}}
I get the following logs:
Starting job of type [macrojob] with identifier [test] Step 0 Step 1 Step 2 Step 3 Step 4 Finished job of type [macrojob] with identifier [test]
However, if I comment out the "sleep(1000)" line, I get a warning between "Step 4" and "Finished job [...]":
Impossible to pop namespace [xwiki:Test] because current namespace is [DefaultIconRenderer]
The text after "current namespace is" varies between runs (xwiki:Test being the name of the page I'm writing my code in).
I don't expect the the execution time of the steps to change anything. This looks like a race condition.