-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Hello,
Presently, the mosquitto MQTT library ignores SIGPIPE:
This is a problem since this will affect all threads of the process running the mosquitto client library. Furthermore, as per signal(7) “A child created via fork(2) inherits a copy of its parent's signal dispositions.”. That is, any process forked from the process which uses the mosquitto client library will also ignore SIGPIPE by default. I believe it to be a very bad idea to have a C library introduce this sort of side-effect since code using the C library may require SIGPIPE to not be ignored.
We noticed this at Alpine Linux where we use mosquitto as part of our build infrastructure. See:
- Restore default SIGPIPE handler after fork() ncopa/mqtt-exec#7
- https://gitlab.alpinelinux.org/alpine/infra/infra/-/issues/10758
Opening this issue here in the hopes that you might consider not modifying signal dispositions in the mosquitto library.