statistics: Fix NPE

Fixes

java.lang.NullPointerException: null
        at diskCacheV111.services.PoolStatisticsV0.printTotal(PoolStatisticsV0.java:1219) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtml(PoolStatisticsV0.java:1151) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtmlFiles(PoolStatisticsV0.java:1056) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.access$1100(PoolStatisticsV0.java:119) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0$HourlyRunner.run(PoolStatisticsV0.java:441) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at dmg.cells.nucleus.CellNucleus$3.run(CellNucleus.java:707) [cells-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]

If there is no data, we cannot print a total.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6963/
(cherry picked from commit 01941732a40f7be8abfbaf4cb5c9bc4cba96fc0e)
dcache alarms: add missing configuration elements and documentation for SMTP appender

This is a minimal backport of http://rb.dcache.org/r/6949.

Instead of adding support for exposing the entire configuration
of the SMTP appender through the dcache property framework,
we have simply added the missing elements, plus explanatory
comments, to the logback-server.xml.

Target: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Patch: http://rb.dcache.org/r/6957
Acked-by: Paul
Merge pull request #522 from gbehrmann/fix/2.9/rb6963

Fix/2.9/rb6963
Merge pull request #525 from alrossi/fix/2.9/alarms-email-configuration

Fix/2.9/alarms email configuration
[maven-release-plugin] prepare release 2.9.1
[maven-release-plugin] prepare for next development iteration
fhs: Use gzip compression for deb package

Ubuntu 14.04 defaults to xv which isn't supported by Ubuntu 10.10.
To restore compatibility, this patch explicitly sets the compression
format to gzip.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: no
Require-book: no
(cherry picked from commit 4b7d7a057f9fbbea32eeffb8caa741e62235c992)
Merge pull request #530 from gbehrmann/fix/2.9/rb6964

Fix/2.9/rb6964
pnfsmanager: Fix expected size extraction and tag caching

The expected file size tag is not extracted correctly when creating new
files. The tag caching also wasn't as effective as intended: To fix
this I had to add caching of the parent tag.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.9
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6975/
(cherry picked from commit d078fdb96a6081d578bf133f4a83017b239e98cb)
srm: Drop fail fast for protocol checks

For both get and put the requested protocol is compared to supported
protocols before creating the schedulable request objects. I guess
this was supposed to provide a fail-fast path. However it means we

- Don't leave behind the request object for subsequent analysis.

- Do a non-trivial operation in the Jetty thread when we have
  a perfectly fine scheduler to deal with this.

- Duplicate checks as the Storage class already checks this while
  selecting a door.

This patch gets rids of the duplication. I submit this for 2.9 as is
resolves a regression (in the old code the protocols were fetched
differently).

Target: trunk
Request: 2.9
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6977/
(cherry picked from commit 0f5a4d579476094c12e393bd14fdccb90ba99826)
srm: Schedule resubmit of pin request to avoid deadlock

Since the callback happens on the delivery thread, we shouldn't do
anything heavy in it (such as doing a protocol support check that
may involve querying login broker - something that would cause a
deadlock as the reply would not be deliverable).

Target: trunk
Request: 2.9
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6978/
(cherry picked from commit e0e9a510a51b037e8b0e16fcef449af78e6c0272)
srm: Fix deadlock in pinning

Another case of me being too optimistic about how much or how little
happens in a message callback. In this case pinning uses the remote
pool monitor, which may tricker a fetch from pool manager.

Target: trunk
Request: 2.9
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6979/
(cherry picked from commit d90196a5a324363943bd26b9bafefc2d197f6184)
Merge pull request #538 from gbehrmann/fix/2.9/rb6978

Fix/2.9/rb6978
Merge pull request #537 from gbehrmann/fix/2.9/rb6977

Fix/2.9/rb6977
Merge pull request #536 from gbehrmann/fix/2.9/rb6975

Fix/2.9/rb6975
Merge pull request #539 from gbehrmann/fix/2.9/rb6979

Fix/2.9/rb6979
systemtest: regenerate host credentials, add user credentials

Patch adds new host credentials so the system-test continues to work
out-of-the-box.  The patch also adds user-certificates generated by
the same Disposable CA.  This should allow people without an X.509
certificate to use system-test without first regenerating credentials.

Target: master
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
webdav: work-around race-condition in StringTemplate library

StringTemplate has a lazy-load for parsing the template file.  It
turns out that this is very racy, with at least two race-conditions.

Once race-condition has the effect that if two threads attempt to
fetch a template at about the same time with the template file not
loaded then the template being requested by the second thread (the one
that lost the race, so not loading the template file) will be never be
available.

Since dCache uses STGroupFile object to render only one template, this
means that if two threads attempt to fetch the template close enough
together then the template is never available and null is returned.
Because of another problem, this triggers a NPE.

A symptom of this problem is that dCache (> 2.6) will log a single
entry

   "redefinition of template <name>"

where <name> is the template that is no longer available.

The work-around is to force the loading and parsing the template file
by the thread creating the cell.  This removes the race-condition and
the file is loaded correctly.

There is another race-condition that results in multiple threads
attempting to load and parse the file.  This will result in dCache
logging a line like:

   "redefinition of template <name>"

for each template and for each additional thread that attempts to load
the file. While noisy, this should only happen (if at all) for "a
while" after initialising and does not affect the correctness of the
rendered response.

Target: master
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Bug-report: http://rt.dcache.org/Ticket/Display.html?id=8315
Bug-report: (private correspondance with DESY people)
Patch: http://rb.dcache.org/r/6986/
Acked-by: Gerd Behrmann
Merge pull request #540 from paulmillar/fix/2.9/stringtemplate-race

webdav: work-around race-condition in StringTemplate library
hsm scripts: fix command and options order

the order of command and options as they are used currently, breaks the
use of several hsm scripts.
This patch reorders the components to be

<command> put|get -si=... [-o1=.., ...]

Ticket: 8317
Acked-by:
Target: trunk
Target: 2.9
Require-book: no
Require-notes: no