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.


I am currently getting two test failures that I cannot explain:

Failed tests:
testParameterizedStyle(org.geoserver.wms.featureinfo.GetFeatureInfoJSONTest):
expected:<[1]> but was:<[0]>

testParameterizedStyle(org.geoserver.wms.wms_1_1_1.GetFeatureInfoTest):
expected:<[1]> but was:<[0]>

My change does not touch anything related to getFeatureInfo or styles, yet
these tests fail on my branch but pass on master. Any ideas?

I am also currently looking into adding an exceptions format that allows
returning of a partial image if a GetMap fails during timeout.

Feedback is welcome.


Torben


On Fri, Apr 17, 2015 at 9:15 AM, Torben Barsballe <
[email protected]> wrote:

> Yes, the code I am writing uses the minimum of the two, as long as both
> are nonzero.
>
> Torben
>
> On Fri, Apr 17, 2015 at 9:12 AM, Andrea Aime <[email protected]
> > wrote:
>
>> On Fri, Apr 17, 2015 at 6:05 PM, Torben Barsballe <
>> [email protected]> wrote:
>>
>>> Hello,
>>>
>>> I propose to add a format parameter (format_options=timeout:<timeout>)
>>> to the WMS RenderedImageMapOutputFormat that allows users to specify a
>>> timeout on individual requests (As opposed to the global WMS configuration 
>>> *maxRenderingTime
>>> *option.
>>>
>>> In conjunction with this, I would like to add an exceptions
>>> <http://docs.geoserver.org/stable/en/user/services/wms/reference.html#exceptions>
>>> option to return a partial image if rendering is interrupted.
>>>
>>> I have prototyped some of this functionality locally, and it seems
>>> viable.
>>>
>>
>> Sounds like an interesting improvement, provided the code uses the lowest
>> between the globally configured limit and the user provided one.
>> Allowing users to go beyond the admin configured limit is just going to
>> make it too easy to mount a DOS attack on the cheap.
>>
>> 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.
>>
>> -------------------------------------------------------
>>
>
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to