aboutgitcodebugslistschat
path: root/pasta.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-02-15 23:24:32 +0100
committerStefano Brivio <sbrivio@redhat.com>2024-02-16 08:47:14 +0100
commit8f3f8e190c43fc6a3adc7912aaa262e86f9d0748 (patch)
tree52538ea8bd1e6d89062a2eaeaeaeb405c734433d /pasta.h
parentf57a2fb4d5ee8728d92250fc6eb45ffeab221990 (diff)
downloadpasst-8f3f8e190c43fc6a3adc7912aaa262e86f9d0748.tar
passt-8f3f8e190c43fc6a3adc7912aaa262e86f9d0748.tar.gz
passt-8f3f8e190c43fc6a3adc7912aaa262e86f9d0748.tar.bz2
passt-8f3f8e190c43fc6a3adc7912aaa262e86f9d0748.tar.lz
passt-8f3f8e190c43fc6a3adc7912aaa262e86f9d0748.tar.xz
passt-8f3f8e190c43fc6a3adc7912aaa262e86f9d0748.tar.zst
passt-8f3f8e190c43fc6a3adc7912aaa262e86f9d0748.zip
pasta: Add fallback timer mechanism to check if namespace is gone
We don't know how frequently this happens, but hitting fs.inotify.max_user_watches or similar sysctl limits is definitely not out of question, and Paul mentioned that, for example, Podman's CI environments hit similar issues in the past. Introduce a fallback mechanism based on a timer file descriptor: we grab the directory handle at startup, and we can then use openat(), triggered periodically, to check if the (network) namespace directory still exists. If openat() fails at some point, exit. Link: https://github.com/containers/podman/pull/21563#issuecomment-1943505707 Reported-by: Paul Holzinger <pholzing@redhat.com> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'pasta.h')
-rw-r--r--pasta.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/pasta.h b/pasta.h
index 5d20063..4b063d1 100644
--- a/pasta.h
+++ b/pasta.h
@@ -13,7 +13,8 @@ void pasta_start_ns(struct ctx *c, uid_t uid, gid_t gid,
int argc, char *argv[]);
void pasta_ns_conf(struct ctx *c);
void pasta_child_handler(int signal);
-int pasta_netns_quit_init(const struct ctx *c);
-void pasta_netns_quit_handler(struct ctx *c, int inotify_fd);
+void pasta_netns_quit_init(const struct ctx *c);
+void pasta_netns_quit_inotify_handler(struct ctx *c, int inotify_fd);
+void pasta_netns_quit_timer_handler(struct ctx *c, union epoll_ref ref);
#endif /* PASTA_H */