dev@glassfish.java.net

Re: InstanceState service : getting the state of an instance

From: Vijay Ramachandran <vijay.ramachandran_at_oracle.com>
Date: Wed, 07 Jul 2010 17:30:20 -0700

On 7/7/10 3:39 PM, Byron Nevins wrote:
> It doesn't work in my hands --
>
> 1) Nit: it reports the instance as running long before the instance
> can accept commands on its admin port
> 2) If I kill the instance with ^C or kill *or even stop-instance *-->
> the state remains as "running".
>
> Once the instance starts -- it is reported as RUNNING forever -- no
> matter what happens later.

I hope you read my first message entirely. I wrote "as of now it just
makes two state changes" - which is RUNNING to RESTART-REQUIRED - that
is all.

I also wrote "soon this will interact with GMS sub system and every
other state change willbe reflected" - means, this is not yet talking to
GMS system.

Once this service talks to the GMS sub system the state changes will be
STARTING to RUNNING to DEAD to KILLED to HANGING to whatever

Why I sent the message before this service "completely ready" was to let
other developers start using this rather than using uptime kind of
commands to ping an instance.

Vijay
>
>
>
> On 7/7/2010 3:21 PM, Vijay Ramachandran wrote:
>> On 7/7/10 3:12 PM, Byron Nevins wrote:
>>> GMS will handle updating the state of stand-alone instances?
>>> Perfectly?
>>
>> That is my understanding. Joe / Bobby can confirm that.
>>
>> Vijay
>>
>>>
>>>
>>> On 7/7/2010 2:44 PM, Vijay Ramachandran wrote:
>>>> On 7/7/10 2:27 PM, Byron Nevins wrote:
>>>>> How are you guaranteeing that the cached state in
>>>>> InstanceStateImpl reflects reality? E.g. what if I "kill -9" an
>>>>> instance -- how does the cached state change to not-running?
>>>>
>>>> I will depend on GMS for that.
>>>>
>>>> Vijay
>>>>
>>>>>
>>>>>
>>>>> On 7/7/2010 10:02 AM, Vijay Ramachandran wrote:
>>>>>> For those CLI/module owners who want a way to get the state of an
>>>>>> instance at any time :
>>>>>>
>>>>>> A new service, InstanceState, has been introduced. You can use
>>>>>> this by doing the following in your code :
>>>>>>
>>>>>> @Inject InstanceState state;
>>>>>>
>>>>>> As of now, this service interacts with the command replication
>>>>>> framework and, hence, the state of an instance changes from
>>>>>> RUNNING to RESTART_REQUIRED only. Soon this service will interact
>>>>>> with GMS subsystem and every other instance state change will be
>>>>>> reflected.
>>>>>>
>>>>>> You may want to consider using this instead doing other forms of
>>>>>> pinging an instance (like doing uptime / version / locations
>>>>>> command) to see if an instance is alive.
>>>>>>
>>>>>> Let me know if you have any feedback / comments / issues with this.
>>>>>>
>>>>>> Vijay
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>>
>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> --
> Byron Nevins - Oracle Corporation
> Home: 650-359-1290
> Cell: 650-784-4123
> Sierra: 209-295-2188
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net For
> additional commands, e-mail: dev-help_at_glassfish.dev.java.net