srm: Fix request expiration

Fixes an issue in which request expiration caused requests to be marked
as completed with success rather than as failed. The same issue would
also lead to messages about illegal state transitions from Failed to
Done in the log file.

The Job base class supports expiring jobs. When a job is already in
READY or TRANSFERRING, it doesn't fail the job - instead it is marked
as done successfully. I can only guess as to the motivation for this:
Probably becaues for get requests, the TURL is still usable and if
the client got the TURL then the transfer is likely going to succeed.

For put, the put container request had an override for the expiration
to fail the request no matter the state (as long as it is not final
already). However the expiration check is applied to both container
requests and file level requests. The consequence was that although
the container request was marked as failed, the file level request
would be marked as done successfully if expired before the contain
request. Consequently the file was not deleted.

For some requests, the SRM is quite clear that the expiration should
result in SRM_REQUEST_TIMED_OUT. For other requests (eg get) the
text says it should be returned, although the return code is not
listed as a possible return code of srmPrepareToGet. For ls, the
possibility of a timeout is not mentioned at all. I decided to
consider these as flaws in the spec and return SRM_REQUEST_TIMED_OUT
for all expired requests.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.9
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6997/
(cherry picked from commit 4837397fb0c48305e610233f8e446e5b19cee44a)
srm: Fix request cancellation due to SURL deletion

An srmRm cancels requests on the SURL that is deleted. The code however just
changed the state to CANCELED rather that calling abort and thus for put
requests the put wasn't properly aborted - in particular the upload directory
isn't deleted, resulting in those leaking.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.9
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6998/
(cherry picked from commit fd9d0c7f0bc624332f43318473c40910c1a7d312)
chimera: Fix duplicate key supression

The postgresql driver for chimera has logic to avoid duplicate key
errors in postgresql while still throwing the SQLException on the
client side.

Unfortunately, the error code used is inconsistent with the error
code used in other logic that supresses the duplicate key error.

This patch resolves the problem: I checked the other places the
modified methods are called, and code that doesn't rely on the
isDuplicateKeyError just checks whther the error code starts with
'23'. This will still work after the change.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6999/
(cherry picked from commit ee903925e9ea4513b3c553847ad120f62dab5ab3)
Merge pull request #563 from gbehrmann/fix/2.9/rb6999

Fix/2.9/rb6999
Merge pull request #561 from gbehrmann/fix/2.9/rb6998

Fix/2.9/rb6998
Merge pull request #560 from gbehrmann/fix/2.9/rb6997

Fix/2.9/rb6997
xrootd: split protocol name form the client IP in XrootdProtocolInfo

Acked-by: Paul Millar
Target: master, 2.8, 2.9
Require-book: no
Require-notes: yes
(cherry picked from commit 0eb1af0b1c867fe736220ba1dbbf581232c4aefc)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Merge pull request #567 from kofemann/fix-proto-2.9

xrootd: split protocol name form the client IP in XrootdProtocolInfo
srm: Avoid duplicate status code update on status query

Container requests calculate their status code based on the status of
their file requests: However once they reached a final state, that
final state should be used rather than update the state several times.

When requests expire, I have observed illegal state transition errors
caused by trying to update the state several times.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/7000/
(cherry picked from commit 39b2c1153e02882c4b4ae4309d37bffdffbe8f87)
httpd: Fix a couple of bugs

Target: trunk
Require-notes: no
Require-book: no
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/7002/
(cherry picked from commit ed1975e03a69065d1fe2b9af5f2570341e9bd13e)
Merge pull request #568 from gbehrmann/fix/2.9/rb7000

Fix/2.9/rb7000
Merge pull request #571 from gbehrmann/fix/2.9/rb7002

Fix/2.9/rb7002
[maven-release-plugin] prepare release 2.9.2
[maven-release-plugin] prepare for next development iteration
cleaner: Shut down timer thread

Target: trunk
Request: 2.9
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/7003/
(cherry picked from commit a966d7ada711f438657622ae616109a3e374fce9)
ftp,dcap: Don't export child doors

This patch fixes a regression introduced in dCache 2.7.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Require-notes: yes
Require-book: no
Acked-by: Albert Rossi <arossi@fnal.gov>
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/7005/
(cherry picked from commit eeb930158860212fcf3a9360641235fbd57c67b2)
srm: Fix NPE

Restored requests don't have an origin principal and cause an NPE.

Target: trunk
Request: 2.9
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.dE>
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: http://rb.dcache.org/r/7006/
(cherry picked from commit 58192a13e8151572185b1fbddcd360ed45fc0524)
Fix rendering of negative numbers in columm layout

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/7008/
(cherry picked from commit 85d9e29e4b21b808a0599edb26fe37e6d5dae312)
srm: Use srm.enable.space-reservation rather than dcache.enable.space-reservation

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/7009/
(cherry picked from commit 35ab3f8869d91e51e618d19252bb53f09dd53a46)
Merge pull request #576 from gbehrmann/fix/2.9/rb7005

Fix/2.9/rb7005