On Wed, May 13, 2015 at 1:09 AM, Torben Barsballe <
tbarsballe@anonymised.com> wrote:
I have moved my prototype implementation of a timeout format option into
GeoServer as part of the RenderedImageMapOutputFormat. (Pull Request here:
https://github.com/geoserver/geoserver/pull/1055 ).
Changes:
- Added a "timeout" format option to the RenderedImageMapOutputFormat.
Allows users to specify a timeout in ms. The renderer will use the nonzero
minimum of this timout and the WMS global timeout.
- Moved the actual rendering out to a seperate thread. This means that
if we reach the timeout, we can return immedialtly, and let GeoServer clean
up the renderer on its own time, rather than waiting for the current
request to finish.
There is one bit of code that I am a bit leery of adding. The clean up
process for the renderer will forcibly terminate the thread (Thread.stop())
if it does not end itself after 1000 ms of being asked to. This helps keep
geoserver running quickly after timing out a large request, but leads to
its own complications. I feel like there are two options here:
- Keep as-is. Means we are using Thread.stop(), which may result in
memory leaks, headless exceptions, etc.
- Allow the renderer to stop itself, even if it takes a while. If
geoserver gets a large number of massive requests, could lead to all
resources being used waiting for the renderers to clean up after themselves.
Please avoid doing this, we already have one level of thread handling
inside the renderer, please do not add another,
let's find ways to actually stop the rendering if necessary.
For raster based big renders, it could be poisoning the JAI chain somehow,
for large db queries, it could be passing
a timeout hint in the Query objects.
As you said, if we accumulate too many of these large requests waiting to
stop in the background, it will kill the server,
and make control-flow useless (as it will think those requests are still
running).
Cheers
Andrea
--
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------