Re: [Geotools-devel] SchemaCache timeout error

2013-05-22 Thread Andrea Aime
On Thu, May 23, 2013 at 5:48 AM, Ben Caradoc-Davies <
ben.caradoc-dav...@csiro.au> wrote:

> Mauro,
>
> your improvements to SchemaCache have also introduced an unanticipated
> problem triggered by download failure:
> https://jira.codehaus.org/browse/GEOT-4467
>
> You set a 10 second timeout on connections and reads. It turns out that
> some application schemas, including that used in the GeoServer
> app-schema tutorial, import this W3 schema, which often takes more than
> 10 seconds to connect:
> http://www.w3.org/2001/xml.xsd


Ah, this one is a nightmare, it's always super-slow to download (I guess
because
anything XML ends up linking it).
Imho, we should have a copy of it baked directly into code to avoid
downloading it
over and over.


> (1) Why do you set a timeout at all? Just a best practice to avoid an
> application hang? (Good idea!) If so, the obvious workaround is to
> increase the timeout (60 seconds?) to accommodate slow servers. Would
> this be a satisfactory solution?
>

I'd say, make it configurable. 10 seconds to start responding in 2013 is
not slow,
it's a geologic era...


>
> (2) Please look at the logic in SchemaCache.startDownload(). Why is it
> necessary to create an empty file? How should SchemaCache recover when a
> download fails? Please have a look and recommend a solution. I know you
> gave this some thought and I do not want to introduce a deadlock or
> thread blocking that might impact your performance.
>

Fully agree this is a problem


>
> The original AppSchemaCache had no timeout and did not write to a file
> until it had all the bytes of the remote resource, so 9.x is not
> affected by these issues.
>

Right right, good idea to complete the write on disk only when the download
is complete to avoid half downloaded files. But keeping everything in memory
could be dangerous, maybe write a temp file and rename it to the final
destination once done

Cheers
Andrea

-- 
==
GeoServer training in Milan, 6th & 7th June 2013!  Visit
http://geoserver.geo-solutions.it 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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] SchemaCache timeout error

2013-05-22 Thread Ben Caradoc-Davies
Mauro,

your improvements to SchemaCache have also introduced an unanticipated 
problem triggered by download failure:
https://jira.codehaus.org/browse/GEOT-4467

You set a 10 second timeout on connections and reads. It turns out that 
some application schemas, including that used in the GeoServer 
app-schema tutorial, import this W3 schema, which often takes more than 
10 seconds to connect:
http://www.w3.org/2001/xml.xsd

Furthermore, when a download fails, an empty file is created in the 
cache, preventing further download attempts. The cache is poisoned and 
the file must be manually removed. For example, restarting GeoServer 
does not permit another download attempt.

I would like to fix these problems, but I need your advice because I am 
not familiar with your use of SchemaCache and I do not want to, in 
fixing one bug, introduce another and break client code.

(1) Why do you set a timeout at all? Just a best practice to avoid an 
application hang? (Good idea!) If so, the obvious workaround is to 
increase the timeout (60 seconds?) to accommodate slow servers. Would 
this be a satisfactory solution?

(2) Please look at the logic in SchemaCache.startDownload(). Why is it 
necessary to create an empty file? How should SchemaCache recover when a 
download fails? Please have a look and recommend a solution. I know you 
gave this some thought and I do not want to introduce a deadlock or 
thread blocking that might impact your performance.

The original AppSchemaCache had no timeout and did not write to a file 
until it had all the bytes of the remote resource, so 9.x is not 
affected by these issues.

Kind regards,

-- 
Ben Caradoc-Davies 
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SLD and Internationalization

2013-05-22 Thread Jody Garnett
Yeah I like that, more similar to the W3C  approach for html 
documents. 

Only wrinkle would be to define the document default lang, and use  for 
the alternatives. 

-- 
Jody Garnett


On Wednesday, 22 May 2013 at 8:35 AM, Andrea Aime wrote:

> Thinking about it, I would like to propose a further variant that is possibly 
> cleaner on the user's eyes, and better to parse.
> 
> Just like we extended the content of some SLD elements already (think 
> geometry, not limited anymore to a property name)
> we could allow mixed content in Title and Abstract and allow either:
> 
> My title
> 
> or:
> 
> 
> xxx
> yyy
> ...
> 
> 
> which would parse directly into a international string.
> 
> Opinions?
> 
> Cheers
> Andrea
> 
> 
> -- 
> ==
> GeoServer training in Milan, 6th & 7th June 2013!  Visit 
> http://geoserver.geo-solutions.it (http://geoserver.geo-solutions.it/) 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
> 
> --- 
> --
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service 
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> 
> ___
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net 
> (mailto:GeoTools-Devel@lists.sourceforge.net)
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
> 
> 


--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SLD and Internationalization

2013-05-22 Thread Andrea Aime
Thinking about it, I would like to propose a further variant that is
possibly cleaner on the user's eyes, and better to parse.

Just like we extended the content of some SLD elements already (think
geometry, not limited anymore to a property name)
we could allow mixed content in Title and Abstract and allow either:

My title

or:


xxx
yyy
...


which would parse directly into a international string.

Opinions?

Cheers
Andrea


-- 
==
GeoServer training in Milan, 6th & 7th June 2013!  Visit
http://geoserver.geo-solutions.it 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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SLD and Internationalization

2013-05-22 Thread Mauro Bartolomeoli
2013/5/21 Andrea Aime 

> On Tue, May 21, 2013 at 6:42 PM, carlo cancellieri <
> carlo.cancelli...@geo-solutions.it> wrote:
>
>> Mauro,
>>
>>  Can you explain me using an example how you would use the VendorOption
>>> to specify localized versions of a title or abstract?
>>>
>>
>> Well I was thinking to standardize the keys using the I18n standard
>> prefix plus a fixed Keyword, something like:
>>
>> Il titolo
>> The title
>> Questo e' un esempio
>> This is an example
>>
>
> I guess it's a nice balance... does not break too much SLD, it's clear
> it's a vendor extension, and we already
> have option maps in the symbolizers, so why not have them in UserStyle as
> well.
> And more importantly, keeps everything in a single place
>
>
Just a note: for my specific needs I would add VendorOption support to
Rule, not to UserStyle, since it's the Rule title that is shown on
GetLegendGraphic labels. I think the same can be extended to other SLD
elements containing Title and Abstract, such as UserStyle, FeatureTypeStyle
and maybe others.

I will try to prepare a patch (for Geotools and GeoServer) and inform you
when it's ready.

Thanks.
Mauro Bartolomeoli

-- 
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel