mapfish-print icon indicating copy to clipboard operation
mapfish-print copied to clipboard

buildreport Web API documentation

Open kuzkok opened this issue 7 years ago • 3 comments

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.

Create and get report (in one request)
POST /print/:appId/buildreport.:format

Should it be presented in documentation or not? Can we use this route for production?

kuzkok avatar Jun 26 '18 06:06 kuzkok

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 avatar Jul 01 '24 03:07 sanak

@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 avatar Jul 01 '24 04:07 ltshb

@ltshb Okay, thanks for the information!

sanak avatar Jul 01 '24 06:07 sanak