Fwd: Making AbstractWatchKey#MAX_EVENT_LIST_SIZE tunable

Fabian Meumertzheim fabian at buildbuddy.io
Thu Apr 11 12:30:31 UTC 2024


(forwarding for posterity as I didn't reply all)

On Thu, Apr 11, 2024 at 8:14 AM Alan Bateman <Alan.Bateman at oracle.com>
wrote:

>
>
> On 10/04/2024 16:35, Fabian Meumertzheim wrote:
> > When using WatchService to watch a directory, the
> > AbstractWatchKey#MAX_EVENT_LIST_SIZE constant (value: 512) makes it so
> > that e.g. creating 1000 files in a single watched directory inevitably
> > results in an OVERFLOW event.
>
> BTW: Do you handle the OVERFLOW event and use it to re-scan the directory?
>

Yes, the implementation in Bazel discards all incremental information on an
OVERFLOW event and non-incrementally rescans the directories. In fact, at
the moment it goes as far as disabling file watching capabilities entirely
when that happens, presumably to prevent flip-flopping between watching and
non-incremental scanning.


>
> -Alan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20240411/3e838c76/attachment-0001.htm>


More information about the nio-dev mailing list