Notification of shutdown commencing

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Notification of shutdown commencing

Brian Stansberry
I can't figure out a way to produce a notification of an impending
server shutdown if a user does a soft kill of the server process.

It's easy enough if shutdown is initiated by a management op; the op
handler can trigger the notification. But a soft kill triggers a
shutdown hook registered by the MSC ServiceContainer, and once that
starts, services start stopping semi-randomly and its too late to notify
anyone that that is going to start happening.

The MSC shutdown stuff isn't exposed, so there's no way to tie into
that. Adding another shutdown hook doesn't help as there's no
predictable order of execution.

--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

Oleg Kulikov
External monitor?

6 апреля 2012 г. 23:55 пользователь Brian Stansberry <[hidden email]> написал:
I can't figure out a way to produce a notification of an impending
server shutdown if a user does a soft kill of the server process.

It's easy enough if shutdown is initiated by a management op; the op
handler can trigger the notification. But a soft kill triggers a
shutdown hook registered by the MSC ServiceContainer, and once that
starts, services start stopping semi-randomly and its too late to notify
anyone that that is going to start happening.

The MSC shutdown stuff isn't exposed, so there's no way to tie into
that. Adding another shutdown hook doesn't help as there's no
predictable order of execution.

--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

David Lloyd-2
In reply to this post by Brian Stansberry
On 04/06/2012 02:55 PM, Brian Stansberry wrote:

> I can't figure out a way to produce a notification of an impending
> server shutdown if a user does a soft kill of the server process.
>
> It's easy enough if shutdown is initiated by a management op; the op
> handler can trigger the notification. But a soft kill triggers a
> shutdown hook registered by the MSC ServiceContainer, and once that
> starts, services start stopping semi-randomly and its too late to notify
> anyone that that is going to start happening.
>
> The MSC shutdown stuff isn't exposed, so there's no way to tie into
> that. Adding another shutdown hook doesn't help as there's no
> predictable order of execution.

Originally I had assumed (wrongly) at some level that AS 7 would be
completely service-oriented as 5 and 6 were.  The reality is that AS 7
is oriented around management, not services.  I still think that a
service-oriented VM is a valid use case for MSC, however I think that
this is not the case in AS 7.  So I think I should introduce an option
to disable the shutdown hook in MSC, and instead we should create one
for AS 7 which executes a shutdown management operation.

WDYT?
--
- DML
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

Jason T. Greene
Sounds good

Sent from my iPhone

On Apr 7, 2012, at 12:10 PM, "David M. Lloyd" <[hidden email]> wrote:

> On 04/06/2012 02:55 PM, Brian Stansberry wrote:
>> I can't figure out a way to produce a notification of an impending
>> server shutdown if a user does a soft kill of the server process.
>>
>> It's easy enough if shutdown is initiated by a management op; the op
>> handler can trigger the notification. But a soft kill triggers a
>> shutdown hook registered by the MSC ServiceContainer, and once that
>> starts, services start stopping semi-randomly and its too late to notify
>> anyone that that is going to start happening.
>>
>> The MSC shutdown stuff isn't exposed, so there's no way to tie into
>> that. Adding another shutdown hook doesn't help as there's no
>> predictable order of execution.
>
> Originally I had assumed (wrongly) at some level that AS 7 would be
> completely service-oriented as 5 and 6 were.  The reality is that AS 7
> is oriented around management, not services.  I still think that a
> service-oriented VM is a valid use case for MSC, however I think that
> this is not the case in AS 7.  So I think I should introduce an option
> to disable the shutdown hook in MSC, and instead we should create one
> for AS 7 which executes a shutdown management operation.
>
> WDYT?
> --
> - DML
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

Brian Stansberry
+1

On 4/7/12 6:11 PM, Jason Greene wrote:

> Sounds good
>
> Sent from my iPhone
>
> On Apr 7, 2012, at 12:10 PM, "David M. Lloyd"<[hidden email]>  wrote:
>
>> On 04/06/2012 02:55 PM, Brian Stansberry wrote:
>>> I can't figure out a way to produce a notification of an impending
>>> server shutdown if a user does a soft kill of the server process.
>>>
>>> It's easy enough if shutdown is initiated by a management op; the op
>>> handler can trigger the notification. But a soft kill triggers a
>>> shutdown hook registered by the MSC ServiceContainer, and once that
>>> starts, services start stopping semi-randomly and its too late to notify
>>> anyone that that is going to start happening.
>>>
>>> The MSC shutdown stuff isn't exposed, so there's no way to tie into
>>> that. Adding another shutdown hook doesn't help as there's no
>>> predictable order of execution.
>>
>> Originally I had assumed (wrongly) at some level that AS 7 would be
>> completely service-oriented as 5 and 6 were.  The reality is that AS 7
>> is oriented around management, not services.  I still think that a
>> service-oriented VM is a valid use case for MSC, however I think that
>> this is not the case in AS 7.  So I think I should introduce an option
>> to disable the shutdown hook in MSC, and instead we should create one
>> for AS 7 which executes a shutdown management operation.
>>
>> WDYT?
>> --
>> - DML
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

David Lloyd-2
I've added the requisite feature to MSC (see MSC-112) and am planning a
1.1.0.Beta1 release.

One thing to consider is that currently the server shutdown op handler
just calls System.exit().  So our order of operations is pretty much
completely turned around at this point.  But I think that the op handler
could simply be modified to shut down the service container.

On 04/09/2012 09:19 AM, Brian Stansberry wrote:

> +1
>
> On 4/7/12 6:11 PM, Jason Greene wrote:
>> Sounds good
>>
>> Sent from my iPhone
>>
>> On Apr 7, 2012, at 12:10 PM, "David M. Lloyd"<[hidden email]>   wrote:
>>
>>> On 04/06/2012 02:55 PM, Brian Stansberry wrote:
>>>> I can't figure out a way to produce a notification of an impending
>>>> server shutdown if a user does a soft kill of the server process.
>>>>
>>>> It's easy enough if shutdown is initiated by a management op; the op
>>>> handler can trigger the notification. But a soft kill triggers a
>>>> shutdown hook registered by the MSC ServiceContainer, and once that
>>>> starts, services start stopping semi-randomly and its too late to notify
>>>> anyone that that is going to start happening.
>>>>
>>>> The MSC shutdown stuff isn't exposed, so there's no way to tie into
>>>> that. Adding another shutdown hook doesn't help as there's no
>>>> predictable order of execution.
>>>
>>> Originally I had assumed (wrongly) at some level that AS 7 would be
>>> completely service-oriented as 5 and 6 were.  The reality is that AS 7
>>> is oriented around management, not services.  I still think that a
>>> service-oriented VM is a valid use case for MSC, however I think that
>>> this is not the case in AS 7.  So I think I should introduce an option
>>> to disable the shutdown hook in MSC, and instead we should create one
>>> for AS 7 which executes a shutdown management operation.
>>>
>>> WDYT?
>>> --
>>> - DML
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>
>


--
- DML
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

Brian Stansberry
On 4/9/12 10:35 AM, David M. Lloyd wrote:
> I've added the requisite feature to MSC (see MSC-112) and am planning a
> 1.1.0.Beta1 release.
>

Thanks.

> One thing to consider is that currently the server shutdown op handler
> just calls System.exit().  So our order of operations is pretty much
> completely turned around at this point.  But I think that the op handler
> could simply be modified to shut down the service container.
>

Yep. For this reason I hesitated a bit before saying +1 before, but I
think this approach is better than some alternative like adding another
method to the MSC TerminateListener (breaks impls) or adding another
redundant listener API to ServiceContainer.

> On 04/09/2012 09:19 AM, Brian Stansberry wrote:
>> +1
>>
>> On 4/7/12 6:11 PM, Jason Greene wrote:
>>> Sounds good
>>>
>>> Sent from my iPhone
>>>
>>> On Apr 7, 2012, at 12:10 PM, "David M. Lloyd"<[hidden email]>    wrote:
>>>
>>>> On 04/06/2012 02:55 PM, Brian Stansberry wrote:
>>>>> I can't figure out a way to produce a notification of an impending
>>>>> server shutdown if a user does a soft kill of the server process.
>>>>>
>>>>> It's easy enough if shutdown is initiated by a management op; the op
>>>>> handler can trigger the notification. But a soft kill triggers a
>>>>> shutdown hook registered by the MSC ServiceContainer, and once that
>>>>> starts, services start stopping semi-randomly and its too late to notify
>>>>> anyone that that is going to start happening.
>>>>>
>>>>> The MSC shutdown stuff isn't exposed, so there's no way to tie into
>>>>> that. Adding another shutdown hook doesn't help as there's no
>>>>> predictable order of execution.
>>>>
>>>> Originally I had assumed (wrongly) at some level that AS 7 would be
>>>> completely service-oriented as 5 and 6 were.  The reality is that AS 7
>>>> is oriented around management, not services.  I still think that a
>>>> service-oriented VM is a valid use case for MSC, however I think that
>>>> this is not the case in AS 7.  So I think I should introduce an option
>>>> to disable the shutdown hook in MSC, and instead we should create one
>>>> for AS 7 which executes a shutdown management operation.
>>>>
>>>> WDYT?
>>>> --
>>>> - DML
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>>
>
>


--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

David Lloyd-2
More thinking leads me to this conclusion:  we add a container-stop
operation; server shutdown still calls exit(); shutdown hook calls
container-stop.  This way the container is always stopped, and the VM
always shuts down in response to the shutdown operation.

The only problem is that I'm not sure we'll be able to call operations
during the execution of the shutdown operation.  We might have to just
duplicate the handler code or something like that.

On 04/09/2012 10:59 AM, Brian Stansberry wrote:

> On 4/9/12 10:35 AM, David M. Lloyd wrote:
>> I've added the requisite feature to MSC (see MSC-112) and am planning a
>> 1.1.0.Beta1 release.
>>
>
> Thanks.
>
>> One thing to consider is that currently the server shutdown op handler
>> just calls System.exit().  So our order of operations is pretty much
>> completely turned around at this point.  But I think that the op handler
>> could simply be modified to shut down the service container.
>>
>
> Yep. For this reason I hesitated a bit before saying +1 before, but I
> think this approach is better than some alternative like adding another
> method to the MSC TerminateListener (breaks impls) or adding another
> redundant listener API to ServiceContainer.
>
>> On 04/09/2012 09:19 AM, Brian Stansberry wrote:
>>> +1
>>>
>>> On 4/7/12 6:11 PM, Jason Greene wrote:
>>>> Sounds good
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Apr 7, 2012, at 12:10 PM, "David M. Lloyd"<[hidden email]>     wrote:
>>>>
>>>>> On 04/06/2012 02:55 PM, Brian Stansberry wrote:
>>>>>> I can't figure out a way to produce a notification of an impending
>>>>>> server shutdown if a user does a soft kill of the server process.
>>>>>>
>>>>>> It's easy enough if shutdown is initiated by a management op; the op
>>>>>> handler can trigger the notification. But a soft kill triggers a
>>>>>> shutdown hook registered by the MSC ServiceContainer, and once that
>>>>>> starts, services start stopping semi-randomly and its too late to notify
>>>>>> anyone that that is going to start happening.
>>>>>>
>>>>>> The MSC shutdown stuff isn't exposed, so there's no way to tie into
>>>>>> that. Adding another shutdown hook doesn't help as there's no
>>>>>> predictable order of execution.
>>>>>
>>>>> Originally I had assumed (wrongly) at some level that AS 7 would be
>>>>> completely service-oriented as 5 and 6 were.  The reality is that AS 7
>>>>> is oriented around management, not services.  I still think that a
>>>>> service-oriented VM is a valid use case for MSC, however I think that
>>>>> this is not the case in AS 7.  So I think I should introduce an option
>>>>> to disable the shutdown hook in MSC, and instead we should create one
>>>>> for AS 7 which executes a shutdown management operation.
>>>>>
>>>>> WDYT?
>>>>> --
>>>>> - DML
>>>>> _______________________________________________
>>>>> jboss-as7-dev mailing list
>>>>> [hidden email]
>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>
>>>
>>
>>
>
>


--
- DML
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

Brian Stansberry
https://issues.jboss.org/browse/AS7-4492 is the JIRA for this. Scheduled
for 7.2, as these "stopping" notifications are not critical to the
specific use case that got me looking at this.

On 4/9/12 11:12 AM, David M. Lloyd wrote:

> More thinking leads me to this conclusion:  we add a container-stop
> operation; server shutdown still calls exit(); shutdown hook calls
> container-stop.  This way the container is always stopped, and the VM
> always shuts down in response to the shutdown operation.
>
> The only problem is that I'm not sure we'll be able to call operations
> during the execution of the shutdown operation.  We might have to just
> duplicate the handler code or something like that.
>
> On 04/09/2012 10:59 AM, Brian Stansberry wrote:
>> On 4/9/12 10:35 AM, David M. Lloyd wrote:
>>> I've added the requisite feature to MSC (see MSC-112) and am planning a
>>> 1.1.0.Beta1 release.
>>>
>>
>> Thanks.
>>
>>> One thing to consider is that currently the server shutdown op handler
>>> just calls System.exit().  So our order of operations is pretty much
>>> completely turned around at this point.  But I think that the op handler
>>> could simply be modified to shut down the service container.
>>>
>>
>> Yep. For this reason I hesitated a bit before saying +1 before, but I
>> think this approach is better than some alternative like adding another
>> method to the MSC TerminateListener (breaks impls) or adding another
>> redundant listener API to ServiceContainer.
>>
>>> On 04/09/2012 09:19 AM, Brian Stansberry wrote:
>>>> +1
>>>>
>>>> On 4/7/12 6:11 PM, Jason Greene wrote:
>>>>> Sounds good
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> On Apr 7, 2012, at 12:10 PM, "David M. Lloyd"<[hidden email]>      wrote:
>>>>>
>>>>>> On 04/06/2012 02:55 PM, Brian Stansberry wrote:
>>>>>>> I can't figure out a way to produce a notification of an impending
>>>>>>> server shutdown if a user does a soft kill of the server process.
>>>>>>>
>>>>>>> It's easy enough if shutdown is initiated by a management op; the op
>>>>>>> handler can trigger the notification. But a soft kill triggers a
>>>>>>> shutdown hook registered by the MSC ServiceContainer, and once that
>>>>>>> starts, services start stopping semi-randomly and its too late to notify
>>>>>>> anyone that that is going to start happening.
>>>>>>>
>>>>>>> The MSC shutdown stuff isn't exposed, so there's no way to tie into
>>>>>>> that. Adding another shutdown hook doesn't help as there's no
>>>>>>> predictable order of execution.
>>>>>>
>>>>>> Originally I had assumed (wrongly) at some level that AS 7 would be
>>>>>> completely service-oriented as 5 and 6 were.  The reality is that AS 7
>>>>>> is oriented around management, not services.  I still think that a
>>>>>> service-oriented VM is a valid use case for MSC, however I think that
>>>>>> this is not the case in AS 7.  So I think I should introduce an option
>>>>>> to disable the shutdown hook in MSC, and instead we should create one
>>>>>> for AS 7 which executes a shutdown management operation.
>>>>>>
>>>>>> WDYT?
>>>>>> --
>>>>>> - DML
>>>>>> _______________________________________________
>>>>>> jboss-as7-dev mailing list
>>>>>> [hidden email]
>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>> _______________________________________________
>>>>> jboss-as7-dev mailing list
>>>>> [hidden email]
>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>
>>>>
>>>
>>>
>>
>>
>
>


--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of shutdown commencing

Brian Stansberry
A year later, AS7-4492 is resolved.

On 4/12/12 5:05 PM, Brian Stansberry wrote:

> https://issues.jboss.org/browse/AS7-4492 is the JIRA for this. Scheduled
> for 7.2, as these "stopping" notifications are not critical to the
> specific use case that got me looking at this.
>
> On 4/9/12 11:12 AM, David M. Lloyd wrote:
>> More thinking leads me to this conclusion:  we add a container-stop
>> operation; server shutdown still calls exit(); shutdown hook calls
>> container-stop.  This way the container is always stopped, and the VM
>> always shuts down in response to the shutdown operation.
>>
>> The only problem is that I'm not sure we'll be able to call operations
>> during the execution of the shutdown operation.  We might have to just
>> duplicate the handler code or something like that.
>>
>> On 04/09/2012 10:59 AM, Brian Stansberry wrote:
>>> On 4/9/12 10:35 AM, David M. Lloyd wrote:
>>>> I've added the requisite feature to MSC (see MSC-112) and am planning a
>>>> 1.1.0.Beta1 release.
>>>>
>>>
>>> Thanks.
>>>
>>>> One thing to consider is that currently the server shutdown op handler
>>>> just calls System.exit().  So our order of operations is pretty much
>>>> completely turned around at this point.  But I think that the op
>>>> handler
>>>> could simply be modified to shut down the service container.
>>>>
>>>
>>> Yep. For this reason I hesitated a bit before saying +1 before, but I
>>> think this approach is better than some alternative like adding another
>>> method to the MSC TerminateListener (breaks impls) or adding another
>>> redundant listener API to ServiceContainer.
>>>
>>>> On 04/09/2012 09:19 AM, Brian Stansberry wrote:
>>>>> +1
>>>>>
>>>>> On 4/7/12 6:11 PM, Jason Greene wrote:
>>>>>> Sounds good
>>>>>>
>>>>>> Sent from my iPhone
>>>>>>
>>>>>> On Apr 7, 2012, at 12:10 PM, "David M.
>>>>>> Lloyd"<[hidden email]>      wrote:
>>>>>>
>>>>>>> On 04/06/2012 02:55 PM, Brian Stansberry wrote:
>>>>>>>> I can't figure out a way to produce a notification of an impending
>>>>>>>> server shutdown if a user does a soft kill of the server process.
>>>>>>>>
>>>>>>>> It's easy enough if shutdown is initiated by a management op;
>>>>>>>> the op
>>>>>>>> handler can trigger the notification. But a soft kill triggers a
>>>>>>>> shutdown hook registered by the MSC ServiceContainer, and once that
>>>>>>>> starts, services start stopping semi-randomly and its too late
>>>>>>>> to notify
>>>>>>>> anyone that that is going to start happening.
>>>>>>>>
>>>>>>>> The MSC shutdown stuff isn't exposed, so there's no way to tie into
>>>>>>>> that. Adding another shutdown hook doesn't help as there's no
>>>>>>>> predictable order of execution.
>>>>>>>
>>>>>>> Originally I had assumed (wrongly) at some level that AS 7 would be
>>>>>>> completely service-oriented as 5 and 6 were.  The reality is that
>>>>>>> AS 7
>>>>>>> is oriented around management, not services.  I still think that a
>>>>>>> service-oriented VM is a valid use case for MSC, however I think
>>>>>>> that
>>>>>>> this is not the case in AS 7.  So I think I should introduce an
>>>>>>> option
>>>>>>> to disable the shutdown hook in MSC, and instead we should create
>>>>>>> one
>>>>>>> for AS 7 which executes a shutdown management operation.
>>>>>>>
>>>>>>> WDYT?
>>>>>>> --
>>>>>>> - DML
>>>>>>> _______________________________________________
>>>>>>> jboss-as7-dev mailing list
>>>>>>> [hidden email]
>>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>>> _______________________________________________
>>>>>> jboss-as7-dev mailing list
>>>>>> [hidden email]
>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev