udev: increase receive buffer size

With the default 128KiB buffer size it is easy to lose events. For
example when 64 interfaces appear at the same time, we lose events for
the last 16. Increase the buffer size to 4MiB.

https://bugzilla.redhat.com/show_bug.cgi?id=1651578
This commit is contained in:
Beniamino Galvani 2018-12-03 17:51:43 +01:00
parent 24f92ec0a2
commit 5780a2893b

View file

@ -253,6 +253,7 @@ nm_udev_client_new (const char *const*subsystems,
/* listen to events, and buffer them */
if (self->monitor) {
udev_monitor_set_receive_buffer_size (self->monitor, 4*1024*1024);
udev_monitor_enable_receiving (self->monitor);
channel = g_io_channel_unix_new (udev_monitor_get_fd (self->monitor));
self->watch_source = g_io_create_watch (channel, G_IO_IN);