River
  1. River
  2. RIVER-395

Ill-behaved DiscoveryListener can terminate discovery notifier threads

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: jtsk_2.1
    • Fix Version/s: None
    • Component/s: net_jini_discovery
    • Labels:
      None

      Description

      (bug detected in Jini 2.1, still present in 2.1.2+ trunk)

      If a net.jini.discovery.DiscoveryListener implementation throws an unchecked exception, then the LookupLocatorDiscovery$Notifier thread and/or the LookupDiscovery$Notifier thread will exit prematurely. In practice, this can prevent the JoinManager$DiscMgrListener or ServiceDiscoveryManager$DiscMgrListener callbacks from being invoked, resulting in incomplete state for a registrar.

      A soon-to-be attached patch surrounds each listener invocation with a try/catch block.

        Activity

        Hide
        Chris Dolan added a comment -

        LookupDiscovery.java | 27 ++++++++++++++----------
        LookupDiscoveryManager.java | 48 ++++++++++++++++++++++++++++++++++++++------
        LookupLocatorDiscovery.java | 15 +++++++++----
        3 files changed, 68 insertions, 22 deletions

        Wraps DiscoveryListener invocations in try/catch blocks and logs failures.
        I had to add a logger to LookupDiscoveryManager because there was not one present already

        Show
        Chris Dolan added a comment - LookupDiscovery.java | 27 ++++++++++++++---------- LookupDiscoveryManager.java | 48 ++++++++++++++++++++++++++++++++++++++------ LookupLocatorDiscovery.java | 15 +++++++++---- 3 files changed, 68 insertions , 22 deletions Wraps DiscoveryListener invocations in try/catch blocks and logs failures. I had to add a logger to LookupDiscoveryManager because there was not one present already
        Hide
        Hudson added a comment -

        Integrated in River-trunk #481 (See https://builds.apache.org/hudson/job/River-trunk/481/)
        RIVER-395
        Bad listener tests, first version.

        Show
        Hudson added a comment - Integrated in River-trunk #481 (See https://builds.apache.org/hudson/job/River-trunk/481/ ) RIVER-395 Bad listener tests, first version.
        Hide
        Hudson added a comment -

        Integrated in River-trunk #482 (See https://builds.apache.org/hudson/job/River-trunk/482/)
        RIVER-395
        Add QA tests for discovery listener methods that throw an exception.
        RIVER-395
        Apply patch to make discovery event delivery handle throws from listener methods.

        Show
        Hudson added a comment - Integrated in River-trunk #482 (See https://builds.apache.org/hudson/job/River-trunk/482/ ) RIVER-395 Add QA tests for discovery listener methods that throw an exception. RIVER-395 Apply patch to make discovery event delivery handle throws from listener methods.

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Dolan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development