[OpenIndiana-discuss] SMF retries count

Jim Klimov jimklimov at cos.ru
Tue Mar 26 15:15:32 UTC 2013


Well, regarding the glassfish part of the problem, the 60sec timeout
is hardcoded unconfigurable in the admin-cli part of the project.

http://java.net/projects/glassfish/sources/svn/content/tags/3.1.1-b12/admin/cli/src/main/java/com/sun/enterprise/admin/cli/StopDomainCommand.java?rev=60828

Grep for WAIT_FOR_DAS_TIME_MS if interested.

Likewise, the start timeout is specified as well somewhere in the code:

http://java.net/projects/glassfish/sources/svn/content/tags/3.1.1-b12/admin/cli/src/main/java/com/sun/enterprise/admin/cli/StartServerHelper.java?rev=60828

import static 
com.sun.enterprise.admin.cli.CLIConstants.WAIT_FOR_DAS_TIME_MS;

I see that the start method also goes into maintenance for us (exceeding
the 600sec timeout), but the JVM stays alive and ultimately starts up.


I guess the solution here would be to wrap the stop/startup into a
script which would monitor the logs for "I'm started/dead" kind of
message and the JVM process "aliveness" and only exit then. Been
there, done that for Tomcat and JBOSS... Just one more plugin to
add into another mega-script of mine ;)

Now, if there are things I might do on SMF's side (like the question
I came with originally - increase number of retries), I'd still be
interested to know! ;)

Thanks for discussion,
//Jim

On 2013-03-26 14:26, Jim Klimov wrote:
> On 2013-03-26 14:09, Michael Stapleton wrote:
>> Hi Jim,
>>
>> Your SMF method is likely running asadmin.
>>
>> Have you tried using the asadmin command directly to stop the domain?
>> It sounds like it could be the default 60 second socket timeout when
>> asadmin attempts to contact glassfish.
>> Network issues? Glassfish already down?
>
>
> Yes, the default SMF integration of glassfish invokes asadmin with
> such actions as start-domain and stop-domain. I do want to have it
> managed by SMF since that's catered for, and these actions to seem
> to include a timeout (60s for stop, 600s for start), both of which
> are exceeded in this instance; I am looking into GlassFish code now
> to see if these two timeouts are hard-coded or configurable (aren't
> according to the docs).
>
>  From what I gather, when these 60 or 600 seconds elapse, the admin
> CLI verifies the server state. If it was stopping but still runs,
> or if it was starting but still doesn't accept connections, the
> asadmin program (a java class, ultimately) returns a non-zero exit
> code. Thus the SMF method fails (despite configured lack of SMF's
> own timeouts), even though the server happily starts or stops a
> few minutes past the existing asadmin timeout.
>
> I am inclined to think this is poor programming on glassfish side,
> but wonder what I can do to properly host and manage the appserver
> via SMF.
>
> PS: If I use asadmin directly, i.e. to restart the appserver, while
> SMF is also enabled, the death of a java process causes SMF to start
> it up again - and my manual invokation of restart also starts it.
> So the two java processes competing for same ports come into conflict.



More information about the OpenIndiana-discuss mailing list