There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-70ac2636-8df2-494a-a4a0-3baa969cccb9 XWIKI-23187 Closed

PDF export can hang indefinitely if the headless Chrome crashes or is stopped

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-50c0b15d-e9bb-432e-81b8-dae2ad4aa0c0 Marius Dumitru Florea on 14/Oct/25 15:42
 

The default chromeRemoteDebuggingTimeout of 10s that is used to initialize the read timeout for CDT can be too low for large exports. If you increase the page ready timeout without increasing the chromeRemoteDebuggingTimeout you risk getting a timeout like this:

com.github.kklisura.cdt.services.exceptions.ChromeDevToolsInvocationException: Timeout expired while waiting for server response. at com.github.kklisura.cdt.services.impl.ChromeDevToolsServiceImpl.invoke(ChromeDevToolsServiceImpl.java:149) at com.github.kklisura.cdt.services.invocation.CommandInvocationHandler.invoke(CommandInvocationHandler.java:87) at jdk.proxy763/jdk.proxy763.$Proxy1028.printToPDF(Unknown Source) at org.xwiki.export.pdf.internal.chrome.ChromeTab.printToPDF(ChromeTab.java:155) at org.xwiki.export.pdf.browser.AbstractBrowserPDFPrinter.print(AbstractBrowserPDFPrinter.java:140) at org.xwiki.export.pdf.browser.AbstractBrowserPDFPrinter.print(AbstractBrowserPDFPrinter.java:59) at org.xwiki.export.pdf.internal.job.PDFExportJob.saveAsPDF(PDFExportJob.java:180) at org.xwiki.export.pdf.internal.job.PDFExportJob.exportAsPDF(PDFExportJob.java:104) at org.xwiki.export.pdf.internal.job.PDFExportJob.runInternal(PDFExportJob.java:81) at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246) at org.xwiki.job.AbstractJob.run(AbstractJob.java:223) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840)

I did a few tests, and it seems that chromeRemoteDebuggingTimeout should be at least 1/6 of the page ready timeout. E.g. if you increase the page ready timeout to 600s (10m) then you need to also increase chromeRemoteDebuggingTimeout to at least 100s (1m40s). Note that chromeRemoteDebuggingTimeout is currently not exposed in the PDF export administration section, so you need to set it from xwiki.properties:

export.pdf.chromeRemoteDebuggingTimeout=100