Timeout issue for long running jobs when emailing using Smtp with s3reportStorage
Context
- MapFish print version: 3.28
- OS: Docker camptocamp/mapfish_print:3.28 image running under Windows 10
Describe the bug
When requesting long running print jobs the DEFAULT_ABANDONED_TIMEOUT_IN_SECONDS is being hit despite the job requesting the output to be emailed (and stored to S3).
As a work-around I contemplated continually calling the print/status API until the job is completed. However, when the smtp/email option is used the status of a job is always reported as "done": false and "status": "running", even once the print job has been complete and emailed (perhaps because the pdf is being stored to S3 rather than locally?).
Example status response:
{
"done": false,
"status": "running",
"elapsedTime": 8705,
"waitingTime": 0,
"downloadURL": "/print/report/df679119-b137-4249-9809-e5136f5c3774@bd2e6ab7-7eea-4ce1-aac7-1fc985795ab9"
}
How to reproduce
I'll happily put together some files for reproduction if useful.
Actual results
21:01:58.252 [Post result to registry] INFO o.m.p.s.j.impl.ThreadPoolJobManager - Job 01fbf33a-8277-485b-aa13-b5c84bf4cb24@bd2e6ab7-7eea-4ce1-aac7-1fc985795ab9 is abandoned (no status check within the last 120 seconds)
21:01:58.252 [Post result to registry] INFO o.m.p.s.j.impl.ThreadPoolJobManager - Cancelling job after timeout 01fbf33a-8277-485b-aa13-b5c84bf4cb24@bd2e6ab7-7eea-4ce1-aac7-1fc985795ab9
21:02:43.310 [PrintJobManager-3] INFO o.mapfish.print.servlet.job.PrintJob - Successfully completed print job 01fbf33a-8277-485b-aa13-b5c84bf4cb24@bd2e6ab7-7eea-4ce1-aac7-1fc985795ab9
21:02:45.543 [PrintJobManager-3] INFO o.mapfish.print.servlet.job.PrintJob - Print job canceled spec:
{"layout":"A0 portrait","app":"nztopomap","outputFilename":"nztopomap-print-A0","smtp":{"to":"REDACTED"},"attributes":{"requestHeaders":{"requestHeaders":{"authorization":["Basic REDACTED"],"content-length":["686"],"cookie":["JSESSIONID=REDACTED"],"postman-token":["REDACTED"],"host":["127.0.0.1:8080"],"content-type":["text/plain"],"connection":["keep-alive"],"cache-control":["no-cache"],"accept-encoding":["gzip, deflate, br"],"user-agent":["PostmanRuntime/7.28.1"],"accept":["*/*"]}},"descriptionLine1":"Grid squares: 1 × 1 km","descriptionLine2":"Map series: Topo50 WGS 84","map":{"rotation":0,"center":[18784705.449195204,-5601964.859961633],"layers":[{"baseURL":"http://tiles-a.data-cdn.linz.govt.nz/services;key=REDACTED/tiles/v4/layer=50767/EPSG:3857/{z}/{x}/{y}.png","type":"OSM"}],"scale":158191.41505974145,"projection":"EPSG:3857","dpi":300}},"outputFormat":"pdf"}
01fbf33a-8277-485b-aa13-b5c84bf4cb24@bd2e6ab7-7eea-4ce1-aac7-1fc985795ab9
21:02:45.639 [PrintJobManager-3] INFO o.mapfish.print.servlet.job.PrintJob - Emailing error to REDACTED
21:07:29.408 [http-nio-8080-exec-5] WARN o.m.print.servlet.BaseMapServlet - Error while processing request: task cancelled (timeout)
Expected results
Email / smtp jobs should not be abandoned with a timeout as they aren't actually abandoned.