[OpenIndiana-discuss] SMF retries count
DormitionSkete@hotmail.com
dormitionskete at hotmail.com
Tue Mar 26 15:52:12 UTC 2013
On Mar 26, 2013, at 9:15 AM, Jim Klimov wrote:
> 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.
>
> _______________________________________________
> OpenIndiana-discuss mailing list
> OpenIndiana-discuss at openindiana.org
> http://openindiana.org/mailman/listinfo/openindiana-discuss
>
FWIW - Do you really need to use Glassfish, or could you get by with something simpler, like Tomcat?
Last year, I started writing a new ecommerce store using JSF and PrimeFaces. I was running into all sorts of problems when I first started out - when I was trying to use Glassfish. I switched to Tomcat7, and all those problems ceased - except for the work itself!
So, if you haven't already, you might want to ask yourself if you really need the additional functionality (and complexity, and problems) Glassfish offers.
And if you do, after you get it working, please make a wiki page or something in case I have to go back to Glassfish. []:-)
Thanks.
More information about the OpenIndiana-discuss
mailing list