phoenix.Activation seems to deadlock when ActivationGroup fails to start

Narfi Stefansson <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <EFEB6396440FB440ADD8A753B5530B9C102F7214@MESSAGE-AH.ad.mathworks.com>
Dear all,

I have an application that acts as the ActivationGroup in JINI.  If the
application starts successfully, all is well.  However, the application
may exit during startup due to installation problems, license errors,
etc, and that's when I run into the problem that I hope you may be able
to help with.

If the application that acts as the ActivationGroup exists during its
startup, phoenix spawns off watchdog threads which attempt to restart
the application.  If the application can't restart due to unrecoverable
problems such as installation problems or license errors, the watchdog
threads will all fail to restart the application.  This is when they can
all seem to wait indefinitely.  
To be clear, the system remains in the wait state much, much longer than
the groupTimeout.  

I was hoping for phoenix to make 2 attempts to start my application, and
then to throw an exception, but I simply can't get this to happen.  

Has anyone seen anything similar?  Been able to work around it?  Any
help would be appreciated, full details are given below.

Thanks,

Narfi
----
Narfi Stefansson
[email protected] 

I have this problem both in JINI version 2.0.002 and 2.1.  The
description below is in terms of 2.1. 

Debugger shows the following state of the threads:
Watchdog thread:
Object.wait
Activation$GroupEntry.getInstantiator:1169
Activation$GroupEntry.activate:1042
Activation$GroupEntrry.restartServices:745
Activation$GroupEntry$Watchdog.run:1239

Watchdog thread:
Object.wait
Activation$GroupEntry.getInstantiator:1169
Activation$GroupEntry.activate:1042
Activation$GroupEntry.restartServices:745
Activation$GroupEntry$Watchdog.run:1239

Watchdog thread:
Object.wait
Object.wait:474
Activation.Pstartgroup:1811
Activation.access$2600:76
Activation$GroupEntry.getInstantiator:1107
Activation$GroupEntry.activate:1042
Activation$GroupEntry.restartServices:745
Activation$GroupEntry$Watchdog.run:1239

RMI TCP Connection:
Object.wait
Activation$GroupEntry.getInstantiator:1169
Activation$GroupEntry.activate:1042
Activation$$ActivatorImpl.activate:318
NativeMethodAccessorImpl.invoke0

The system remains in this state for much longer than the groupTimeout.

Reading the code, it seems that Activation$GroupEntry.getInstantiator is
meant to throw an exception if startup fails, and that
Activation$GroupEntry.activate is meant to catch that exception and to
try a second time to create the group.

Instead, what seems to happen is that the call to getInstantiator
remains at line 1169, and the WatchDog thread detects that the
application exited.  The WatchDog thread then calls
Activation$GroupEntry.restartServices which calls
Activation$GroupEntry.activate.  This spawns off another WatchDog
thread, which calls Activation$GroupEntry.restartServices which calls
Activation$GroupEntry.activate.  This spawns off another WatchDog thread
...

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.