Xjetty tmp cleaning

Hello,
I’m running XWiki 18.5.0 on Debian 13, with xjetty and postgresql (xwiki stable sources).

I noticed that /var/lib/xwiki/tmp/ stores and accumulates a jetty-0_0_0_0-8080-xwiki-_xwiki-any-<hash> directory on every restart of the xwiki service, and none of the old ones get cleaned up. In my case, this had grown to 57 directories going back to August last year, approaching 900 MB.

I confirmed with lsof +D that none of the old directories are held open by any running process, so they seem safe to delete manually. Are they safe to delete?

Is there an XWiki-recommended way to handle this and keep the size of this tmp directory low, or are these files needed by the engine?

I looked for a dedicated extension, I didn’t find one. Maybe I looked the wrong way? Can I use a script of mine to perform a cleaning once a while when I do administration tasks on the server?

Thanks!

AFAIK those are created by Jetty at startup, but did not really dig why yet.

Hello Thomas,
are there any information I can bring back related to the content of that directory, to help find more about it?

I checked a bit more, and this is apparently the folder created by Jetty for each application to store temporary files.

It used to be a stable one, but maybe Jetty decided to regenerate a new one with each restart in recent versions, which is really not need in the case of XWiki. Maybe there is some configuration that could be added to XJetty to make it a bit more stable. Don’t hesitate to create an issue about that on Loading....

Edit: it seems the problem is that the configured work/ directory (which is supposed to contain the application work dir) is not created and when it does not exist Jetty use the temp folder (which, according to the documentation is supposed to be removed when stopping the application, but does not seem to be the case for you). So I guess the problem is that the Debian package is missing that empty work/ directory (the best is probably to make sure, in the start script, that it exist). I created Loading... and will push a fix for next release.