logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Ståldal <mikael.stal...@magine.com>
Subject Re: Shutdown timeout
Date Wed, 05 Oct 2016 11:46:05 GMT
Configurator.shutdown() simply delegates to LoggerContext.stop().

LoggerContext.stop() does several things, and it is not quite correct to
say that zero timeout mean don't wait. It mean don't wait for background
threads, but it will still wait for appenders and filters, depending on how
they interpret zero timeout.

On Mon, Oct 3, 2016 at 11:35 PM, Gary Gregory <garydgregory@gmail.com>
wrote:

> Right now, in the Configurator.shutdown 0 means do not wait at all.
>
> We could have:
>
> > 0 wait
> = 0 don't wait
> -1 wait forever which could map to Long.MAX_VALUE, TimeUnit.DAYS. What
> where they thinking stopping at DAYS instead of YEARS? Clearly we are
> missing a TimeLocation.EARTH as well ;-)
>
> Gary
>
>
> On Mon, Oct 3, 2016 at 10:07 AM, Mikael Ståldal <mikael.staldal@magine.com
> > wrote:
>
>> There is some confusion about what the default value for timeout should
>> be, and what 0 should mean, and whether we should use 0 or -1 to mean "wait
>> forever".
>>
>> The Java API docs are not very clear about this here:
>> http://docs.oracle.com/javase/8/docs/api/java/util/concurren
>> t/Future.html#get-long-java.util.concurrent.TimeUnit-
>>
>> http://docs.oracle.com/javase/8/docs/api/java/util/concurren
>> t/ExecutorService.html#awaitTermination-long-java.
>> util.concurrent.TimeUnit-
>>
>> but clear that zero mean wait forever here:
>> http://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#join-long-
>>
>> We are unclear in org.apache.logging.log4j.core.util.ExecutorServices where
>> the docs says < 0 to wait forever, but the implementation actually do it
>> for <= 0.
>>
>> We are also unclear in org.apache.logging.log4j.core.LifeCycle2 what 0
>> and < 0 actually mean.
>>
>> We need to clear this up, it is needed for https://issues.apache.org/
>> jira/browse/LOG4J2-1623
>>
>> I suggest that we in ExecutorServices update the docs to match the
>> implemenation, and in LifeCycle2 specify that 0 mean the default timeout
>> for the component (this is what is currently implemented) and -1 for wait
>> forever.
>>
>> --
>> [image: MagineTV]
>>
>> *Mikael Ståldal*
>> Senior software developer
>>
>> *Magine TV*
>> mikael.staldal@magine.com
>> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
>>
>> Privileged and/or Confidential Information may be contained in this
>> message. If you are not the addressee indicated in this message
>> (or responsible for delivery of the message to such a person), you may
>> not copy or deliver this message to anyone. In such case,
>> you should destroy this message and kindly notify the sender by reply
>> email.
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Mime
View raw message