AsyncAppender has a shutdownTimeout parameter. It would be good to have
something similar for async loggers. It is important to not block JVM
shutdown forever.

On Thu, Jun 30, 2016 at 5:56 PM, Remko Popma <remko.po...@gmail.com> wrote:

> At the time it was on purpose but now I think about it more I agree it is
> better to use some timeout.
> Not sure when I will be able to get to it. Would you mind raising a Jira
> for this so we won't forget about it?
>
> Remko
>
> On Thu, Jun 30, 2016 at 4:10 AM, David Leonhartsberger <leozi...@gmail.com
> >
> wrote:
>
> > I was just looking at the AsyncLoggerDistruptor#stop() and figured out
> that
> > the shutdown time is not configurable and it even could be blocking
> forever
> > waiting that the Disruptor backlog has been processed.
> >
> >
> > // Calling Disruptor.shutdown() will wait until all enqueued events are
> > fully processed,
> > // but this waiting happens in a busy-spin. To avoid (postpone) wasting
> > CPU,
> > // we sleep in short chunks, up to 10 seconds, waiting for the ringbuffer
> > to drain.
> > for (int i = 0; hasBacklog(temp) && i <
> MAX_DRAIN_ATTEMPTS_BEFORE_SHUTDOWN;
> > i++) {
> > try {
> > Thread.sleep(SLEEP_MILLIS_BETWEEN_DRAIN_ATTEMPTS); // give up the CPU
> for a
> > while
> > } catch (final InterruptedException e) { // ignored
> > }
> > }
> > temp.shutdown(); // busy-spins until all events currently in the
> disruptor
> > have been processed
> >
> >
> > I was wondering why the "temp.shutdown()" call does not use a
> > (configurable) timeout?
> > Was this a design decision or was it just overlooked?
> >
> > Br,
> > DavidL
> >
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.stal...@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.

Reply via email to