#795 closed defect (fixed)
Connection closed on parallel WCS requests when one query fails
Reported by: | Piero Campalani | Owned by: | Dimitar Misev |
---|---|---|---|
Priority: | major | Milestone: | 9.0.x |
Component: | petascope | Version: | development |
Keywords: | parallel psql exception | Cc: | damiano, Dimitar Misev, mantovani, Peter Baumann |
Complexity: | Medium |
Description
There is a thread-safety issue in the handling of Postgres connections that is revealed when due parallel queries are run, but one of them fails (by requesting a non-existent coverage).
I tried sending N requests in parallel, half of them with wrong coverage ID:
$ declare -a URLLIST=(\ 'http://localhost:8080/rasdaman/ows/wcs2?service=WCS&version=2.0.1&request=GetCoverage&coverageId=irr_cube_scam&subset=E(80000,100000)&subset=N(5100000,5124000)&subset=ansi(148654)&scaleextent=E(0:0)' \ 'http://localhost:8080/rasdaman/ows/wcs2?service=WCS&version=2.0.1&request=GetCoverage&coverageId=irr_cube_2&subset=E(80000,100000)&subset=N(5100000,5124000)&subset=ansi(148654)&scaleextent=E(0:0)') for i in {0..10}; do ( (( $i % 2 == 0)); wget ${URLLIST[$?]} -O out${i}.xml &) ; done
(thanks MEEO Srl for reporting), it happens that a closed connection is trying to get used:
ERROR [14:05:29] DbMetadataSource@1324: Failed reading the coverage metadata org.postgresql.util.PSQLException: This connection has been closed. ... at petascope.core.DbMetadataSource.read(DbMetadataSource.java:941) at petascope.util.WcsUtil.getMetadata(WcsUtil.java:105) at petascope.wcs2.parsers.GetCoverageMetadata.<init>(GetCoverageMetadata.java:98) at petascope.wcs2.extensions.GmlFormatExtension.handle(GmlFormatExtension.java:66) at petascope.wcs2.handlers.GetCoverageHandler.handle(GetCoverageHandler.java:53) ...
I tried up to 20 queries but can't reproduce it.
Apparently this affect v9.0.2 only, while v9.0.1 is still ok.
I wonder if changeset:216edb0 ('ticket:713 - fix database connection leaks in petascope'
) has some responsibility here or not.
Change History (15)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 10 years ago
comment:4 by , 10 years ago
postgresql-libs-8.4.20-1.el6_5.x86_64
postgresql-server-8.4.20-1.el6_5.x86_64
postgresql-8.4.20-1.el6_5.x86_64
comment:8 by , 10 years ago
Once the patch is applied, yes. If it's urgent you could easily build the petascope war, I don't have a VM with Java 6 at the moment.
comment:9 by , 10 years ago
It is urgent and, you know, our update/upgrade process is based on RPM packages: the sooner you build them, the better it is
comment:10 by , 10 years ago
Yes I understand that. I'm sure Peter will soon check and apply the patch.
comment:14 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in changeset:dd6bbe1
comment:15 by , 10 years ago
I can confirm that the issue is fixed
New petascope rpm (9.0.3) works fine
Damiano
Damiano, you have postgresql 8.4?