cells: Catch UnresolvedAddressException

We have observed the following error in our logs:

13 Jan 2014 13:26:20 (lm) [] Uncaught exception in thread TunnelConnector
java.nio.channels.UnresolvedAddressException: null
        at sun.nio.ch.Net.checkAddress(Net.java:127) ~[na:1.7.0_45]
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:640) ~[na:1.7.0_45]
        at java.nio.channels.SocketChannel.open(SocketChannel.java:184) ~[na:1.7.0_45]
        at dmg.cells.network.LocationManagerConnector.connect(LocationManagerConnector.java:103) ~[cells-2.7.4.jar:2.7.4]
        at dmg.cells.network.LocationManagerConnector.run(LocationManagerConnector.java:153) ~[cells-2.7.4.jar:2.7.4]
        at dmg.cells.nucleus.CellNucleus$1.run(CellNucleus.java:674) ~[cells-2.7.4.jar:2.7.4]
        at java.lang.Thread.run(Thread.java:744) ~[na:1.7.0_45]

This patch fixes this problem by translating the exception to an
IOException with additional information about the address that could
not be resovled.

Target: trunk
Request: 2.7
Request: 2.6
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Acked-by: Paul Millar <paul.millar@desy.de>
(cherry picked from commit 50084af73b3b5ead96b9e675fd8c723f09c60d56)
pool: Do not save terminated jobs to setup file

Without this patch, cancelled permanent jobs will resurrect after a
pool restart. Also fixes the 'migration clear' command to remove
failed jobs too.

Target: trunk
Request: 2.7
Request: 2.6
Require-book: no
Require-notes: yes
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6420/
(cherry picked from commit 9ba476abe7b1432c4300b12edc36a57c2f150e18)
Merge pull request #378 from gbehrmann/fix/2.6/rb6393

cells: Catch UnresolvedAddressException
Merge pull request #381 from gbehrmann/fix/2.6/rb6420

pool: Do not save terminated jobs to setup file
pom: enforce maven-release-plugin 2.4.2

the latest plugin broke git support.

Acked-by: Gerd Behrmann
Target: master, 2.7, 2.6
Require-book: no
Require-notes: no
(cherry picked from commit 5a5ccd2d5c3353331881dc5df0645a429df836e9)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
    dcache-webadmin: fix ArrayIndexOutOfBounds exception in ListView (Tape Transfers page)

    The Wicket PropertyModel requires either an object field name or a getter/setter
    name which can be used to invoke by reflection in order to store and retrieve the property value.

    In the case of a ListView, the PropertyModel value is a list; in the case of the TapeTransfersQueue page,
    this list is provided by a service whose DAO abstraction accesses a page cache that is refreshed
    periodically by calling "xrc ls" on the PoolManager.  The current implementation uses a getter
    which extracts a new copy of the list from cache.

    This getter, however, is invoked each time the "populateItem" method is called (that is, for each list item);
    aside from being inefficient, this could cause an indexing problem if the size of the underlying
    list changes in the middle of the procedure to populate the entire list; specifically, the
    reported bug suggests that either the original or the current list size is used to determine
    the successive iteration, but on that successive call, the list size has been reduced (by one),
    causing an IndexOutOfBounds exception.

    The solution here is to associate a stable instance of the list with the page constructor.
    There is no problem in terms of updating the page values, since this particular page is only
    refreshed manually by reloading. A fresh copy of the list will be obtained from the cache on
    each reload, which calls the page constructor.

    Testing:

    Before this patch, loading the page causes the browser to hang and
    the following stack trace is observed in the log:

    1.04.37 [qtp1040303644-45] [] Unexpected error occurred
    org.apache.wicket.WicketRuntimeException: Error attaching this container for
    rendering: [Page class = org.dcache.webadmin.view.pages.tapetransferqueue.TapeTransferQueue, id = 0, render count = 1]
    ...
    Caused by: java.lang.IndexOutOfBoundsException: Index: 9739, Size: 9739
    at java.util.ArrayList.rangeCheck(ArrayList.java:604) ~[na:1.7.0_25]
    at java.util.ArrayList.get(ArrayList.java:382) ~[na:1.7.0_25]
    at org.apache.wicket.markup.html.list.ListItemModel.getObject(ListItemModel.java:58) ~[wicket-core-1.5.10.jar:1.5.10]

    After patch application, the error no longer occurs.

    Target: 2.6
    Patch: http://rb.dcache.org/r/6527
    Require-book: no
    Require-notes: yes
    Ticket: http://rt.dcache.org/Ticket/Display.html?id=8225
    Acked-by: Tigran
    Committed: ed919cf0eb99da85d594ebbc4d27fba6b1c9d09e

    RELEASE NOTES:  Fixes a bug in the TapeTransferQueue page whereby an IndexOutOfBounds error
    can occur (and hang the page).
Merge pull request #394 from alrossi/fix/2.6/tape-transfer-queue

    dcache-webadmin: fix ArrayIndexOutOfBounds exception in ListView (Ta...
dcache-core, alarms: remove postgresql precondition on schema

There is nothing in the liquibase schema for alarms which specifically requires postgresql.
Removing this precondition allows the rdbms option to be tested in system-test using hsqldb.

Target: 2.6
Patch: http://rb.dcache.org/r/6548/
Require-book: no
Require-notes: no
Acked-by: Gerd
Committed: b84b3fa2fe66b44a9f24dcdeda8cc344780f492b
Merge pull request #390 from kofemann/fix-git-2.6

pom: enforce maven-release-plugin 2.4.2
Merge pull request #404 from alrossi/fix/2.6/alarms-schema

dcache-core, alarms: remove postgresql precondition on schema
[maven-release-plugin] prepare release 2.6.21
[maven-release-plugin] prepare for next development iteration