Open kuzkok opened 6 years ago
Hi,
I have been curious about this, because current job request => status check polling doesn't fit server side redundancy (multiple Docker containers with load balancer).
From glance of the related code, this route seems to wait for response by Thread.sleep
until completion, so I guess that we can't use it in production server, because one user's request may block other user's request (default timeout 10 mins).
https://github.com/mapfish/mapfish-print/blob/3.30.6/core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java#L656-L661
long startWaitTime = System.currentTimeMillis();
final long maxWaitTimeInMillis = TimeUnit.SECONDS.toMillis(this.maxCreateAndGetWaitTimeInSeconds);
while (!isDone && System.currentTimeMillis() - startWaitTime < maxWaitTimeInMillis) {
Thread.sleep(TimeUnit.SECONDS.toMillis(1));
isDone = loadReport(ref, createReportResponse, handler);
}
@sanak I can confirm your code observation, we were using mapfish print (using the master branch) on a k8s cluster using several pod and after a short while all prints were stuck reaching the default 10min timeout. We had to restart the pods to avoid this. Using the latest version 3.30.6 seems to works better on this.
@ltshb Okay, thanks for the information!
@sanak Could you please elaborate on the relation between this issue and lines of code you mentionned in MapPrinterServlet ?
Missing documentation for buildreport.:format at "Web Protocol" description, but it work, and I found description in https://geomapfish-demo.camptocamp.net/course_mapfishprint.pdf.
Should it be presented in documentation or not? Can we use this route for production?