(2.2) dcache (billing) improve error handling in plotting classes

module: dcache (billing plots)

In version 2.2, the plotting code is still from the original version of billing plots (2011), and thus has a number of places which were catching Throwable, or where duplicate logging was implemented.  I had promised to fix these but never got around to it.

This patch changes the Throwable to Exception or something more specific where possible, and eliminates the duplicate logging.  It also eliminates the stack trace at the error level.

Note that DataNucleus unfortunately will continue to log the entire stack trace for errors at the query level.  This is seen from the code, for instance, to

 protected Object performExecuteTask(final Object... args) {
  ...
        catch (ExecutionException e)
        {
            // Exception thrown executing the query
            tasks.remove(Thread.currentThread());
            NucleusLogger.QUERY.error(LOCALISER.msg("021021", toString()), e);
            throw (NucleusException)e.getCause();
        }
 }

where 021021 is the externalized local message "An error occurred when executing query {0}".  This is what we observe still in our logs when there is an SQL error.

I have also decided it makes sense to exit from the plotting loop in this case.

Some of this behavior was modified when I rewrote this code for 2.6/2.7.  I will nevertheless still check that the error handling conforms there with the current changes.

Testing done:

After application of patches, noise level in log on SQL errors is greatly reduced, and plotting is shut off on an error.

Target: 2.2
Patch: http://rb.dcache.org/r/5666
Require-notes: yes
Require-book: no
Acked-by: Gerd
Merge-req: https://github.com/dCache/dcache/pull/107

RELEASE NOTES:

The log for the domain where billing plots are generated has been made less verbose at the error level.  If there is a critical/severe (i.e., SQL) error encountered, plotting will stop and will only restart if the domain is restarted.
Merge pull request #125 from alrossi/fix/2.2/plot_error_handling

(2.2) dcache (billing) improve error handling in plotting classes