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.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 > > >