[Geoserver-devel] Monitoring hibernate module breaking build on Windows server

Hi,
the build on the windows server is currently broken on the monitoring hibernate extension
with the following issue (not sure if permanently, or randomly):

Tests run: 25, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.226 sec <<< FAILURE!
org.geoserver.monitor.hib.HibernateMonitorDAO2Test  Time elapsed: 2414 sec  <<< ERROR!
org.h2.jdbc.JdbcSQLException: Cannot delete file C:\.jenkins\jobs\GeoServer-Master\workspace\src\extension\monitor\hibernate\target\monitoring\monitoring.1.log.db [90025-119]
	at org.h2.message.Message.getSQLException(Message.java:106)
	at org.h2.message.Message.getSQLException(Message.java:117)
	at org.h2.message.Message.getSQLException(Message.java:76)
	at org.h2.store.fs.FileSystemDisk.delete(FileSystemDisk.java:150)
	at org.h2.util.FileUtils.delete(FileUtils.java:296)
	at org.h2.tools.DeleteDbFiles.process(DeleteDbFiles.java:108)
	at org.h2.tools.DeleteDbFiles.process(DeleteDbFiles.java:95)
	at org.h2.tools.DeleteDbFiles.execute(DeleteDbFiles.java:77)
	at org.geoserver.monitor.hib.HibernateMonitorDAO2Test.destroy(HibernateMonitorDAO2Test.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

I’ve been looking at the code, and it seems to me that it’s orderly closing down the database connections,
so not sure why this is happening (the above should happen only if H2 is still keeping a finger on those files, no?)

However, there is a simple workaround: have the test use an in memory H2 database instead
of a file based one.

Opinions?

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.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


+1

Could this be related to locking files on windows?
Regards,
Simone Giannecchini

Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

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

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

-------------------------------------------------------

On Sat, Sep 28, 2013 at 9:47 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

Hi,
the build on the windows server is currently broken on the monitoring
hibernate extension
with the following issue (not sure if permanently, or randomly):

Tests run: 25, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.226 sec
<<< FAILURE!
org.geoserver.monitor.hib.HibernateMonitorDAO2Test Time elapsed: 2414 sec
<<< ERROR!
org.h2.jdbc.JdbcSQLException: Cannot delete file
C:\.jenkins\jobs\GeoServer-Master\workspace\src\extension\monitor\hibernate\target\monitoring\monitoring.1.log.db
[90025-119]
  at org.h2.message.Message.getSQLException(Message.java:106)
  at org.h2.message.Message.getSQLException(Message.java:117)
  at org.h2.message.Message.getSQLException(Message.java:76)
  at org.h2.store.fs.FileSystemDisk.delete(FileSystemDisk.java:150)
  at org.h2.util.FileUtils.delete(FileUtils.java:296)
  at org.h2.tools.DeleteDbFiles.process(DeleteDbFiles.java:108)
  at org.h2.tools.DeleteDbFiles.process(DeleteDbFiles.java:95)
  at org.h2.tools.DeleteDbFiles.execute(DeleteDbFiles.java:77)
  at
org.geoserver.monitor.hib.HibernateMonitorDAO2Test.destroy(HibernateMonitorDAO2Test.java:60)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
  at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
  at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
  at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
  at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
  at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
  at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
  at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
  at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
  at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
  at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

I've been looking at the code, and it seems to me that it's orderly closing
down the database connections,
so not sure why this is happening (the above should happen only if H2 is
still keeping a finger on those files, no?)

However, there is a simple workaround: have the test use an in memory H2
database instead
of a file based one.

Opinions?

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.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

-------------------------------------------------------

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Sun, Sep 29, 2013 at 11:23 PM, Simone Giannecchini <
simone.giannecchini@anonymised.com> wrote:

+1

Could this be related to locking files on windows?

Agreed, yet, that woudl happen only if something keeps the file open... and
I see the code
closing down everything (executors for asynch request logging, connection
pool, and so on)
before trying to delete the file, that's why I'm a bit confused as to why
the file is still locked
anyways. Most likely, I'm missing something that is not being closed as it
should, or some
asynch thread that is still on the loose with a hibernat connection in its
hands...

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.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

-------------------------------------------------------

if my memory serves me right, if you lock&map a file on windows there
is not way to unmap explicitly.
As such if you try to delete it right away that will fail. This is why
the fileimageinput stream in imageio-ext uses randomaccess file rather
tha filechannels.

Regards,
Simone Giannecchini

Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

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

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

-------------------------------------------------------

On Sun, Sep 29, 2013 at 10:29 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

On Sun, Sep 29, 2013 at 11:23 PM, Simone Giannecchini
<simone.giannecchini@anonymised.com> wrote:

+1

Could this be related to locking files on windows?

Agreed, yet, that woudl happen only if something keeps the file open... and
I see the code
closing down everything (executors for asynch request logging, connection
pool, and so on)
before trying to delete the file, that's why I'm a bit confused as to why
the file is still locked
anyways. Most likely, I'm missing something that is not being closed as it
should, or some
asynch thread that is still on the loose with a hibernat connection in its
hands...

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.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

-------------------------------------------------------

Oh the fun of windows locking issues. +1 on changing the unit tests to use the h2 in memory option.

···

On Sun, Sep 29, 2013 at 3:31 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

if my memory serves me right, if you lock&map a file on windows there
is not way to unmap explicitly.
As such if you try to delete it right away that will fail. This is why
the fileimageinput stream in imageio-ext uses randomaccess file rather
tha filechannels.

Regards,
Simone Giannecchini

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

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

mob: +39 333 8128928

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


On Sun, Sep 29, 2013 at 10:29 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

On Sun, Sep 29, 2013 at 11:23 PM, Simone Giannecchini
<simone.giannecchini@anonymised.com> wrote:

+1

Could this be related to locking files on windows?

Agreed, yet, that woudl happen only if something keeps the file open… and
I see the code
closing down everything (executors for asynch request logging, connection
pool, and so on)
before trying to delete the file, that’s why I’m a bit confused as to why
the file is still locked
anyways. Most likely, I’m missing something that is not being closed as it
should, or some
asynch thread that is still on the loose with a hibernat connection in its
hands…

Cheers
Andrea

Our support, Your Success! Visit http://opensdi.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



October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive