logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Leonhartsberger <leozi...@gmail.com>
Subject Re: Why is AsyncLogger#shutdown time not configurable?
Date Thu, 30 Jun 2016 20:05:07 GMT
Yes no problem. I can also provide a PR for it if you want.

On Thu, Jun 30, 2016 at 5:56 PM, Remko Popma <remko.popma@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 <leozilla@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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message