On Tue, May 27, 2014 at 10:20 PM, Robert Coup
<robert.coup@anonymised.com>wrote:
Hi folks,
We have a few sizeable GeoServer catalogs... and a reload triggered via
the REST API to /reload can take a few minutes. During this time GeoServer
continues to listen on it's port and queues requests up to process after
the catalog is loaded, which isn't ideal from a user-experience point of
view.
Is there an extension hook to tie into around catalog (re)loading, which
we could use to prevent traffic being routed to the Geoserver instance
until it is all ready to go?
Hmm... not quite, this is the closest thing I can think of, and it's wrong:
you'd need a couple of GeoServerLifecycleHandler implementations, oe at
very high ExtensionPriority, that listens to
onReset, and one at very low ExtesionPriorty, that listens to onReload,
that would mark the begin and end of a
reload cycle (reset is done first, then the reload is done, then the
handlers are notified that the reload happened).
And then have a DispatcherCallback using the above two informations to stop
all incoming requests threads
using some form of synchronization when we are between the two... however,
done this way, a simple reset
would just lock down everything, as the reload event would never come, and
besides, the logic would be
pretty much implementation dependent.
Nope, the GeoServerLifecycleHandler would have to be extended to offer also
a beforeReload callback,
and coded in such a way that the reload event gets fired even if the reload
fails catastrophically (that is,
in a final method) otherwise the server would remain locked down until
restart.
Regardless of the above... such system might interact pretty poorly with
the control-flow extension (which
would probably just decide to kill all requests because they have been
waiting for too long to be executed).
Cheers
Andrea
--
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
-------------------------------------------------------