IN_Q_OVERFLOW 事件未在 python inotify 中引发

IN_Q_OVERFLOW event not being raised in python inotify

inotify 系统显然提出了一个 IN_Q_OVERFLOW event in the event a watcher queue event is raised when the corresponding event queue is full. I'm using the inotify python 包来注册 inotify 事件。我很想知道什么时候引发 IN_Q_OVERFLOW 事件,但似乎 inotify 包完全忽略了这个事件。有没有人对如何通过 inotify 或另一个提供此行为的 python 包注册此事件有任何建议?

来自 inotify 的片段 adapter.py

def __handle_inotify_event(self, wd, event_type):
    """Handle a series of events coming-in from inotify."""

        ....
        if path is None:
            break #if i print header.mask i clearly see 16384 or 0x00004000 the IN_Q_OVERFLOW bit
        yield (header, type_names, path, filename)

代码在这里

解决方案 - pyinotify!添加字符以达到 30...

您可能想试试守望者: https://facebook.github.io/watchman/

包含一个 python 客户端,但 Python 中关于使用它的文档不多。我建议查看 watchman-wait 和 watchman-make 工具的实现

Watchman 的工作方式与大多数文件监视系统略有不同,因为它维护您正在监视的目录树的一致视图。它将在内部处理溢出事件并传递有关它们的信息。默认情况下,它只会告诉您所有文件可能都已更改,因此您无需更改应用程序逻辑,除非您关心发现在溢出事件期间被删除的文件。

免责声明:我创建并维护了 watchman