projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: session conditions not evaluated at subscription/registration
[lttng-tools.git]
/
src
/
bin
/
lttng-consumerd
/
health-consumerd.c
diff --git
a/src/bin/lttng-consumerd/health-consumerd.c
b/src/bin/lttng-consumerd/health-consumerd.c
index bd47f0c497c042c5ec247f8537a62822f89938e4..1e2f31e488b51cb3f42af09adb299ea7448afac2 100644
(file)
--- a/
src/bin/lttng-consumerd/health-consumerd.c
+++ b/
src/bin/lttng-consumerd/health-consumerd.c
@@
-15,7
+15,6
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <fcntl.h>
#include <getopt.h>
#define _LGPL_SOURCE
#include <fcntl.h>
#include <getopt.h>
@@
-37,15
+36,14
@@
#include <unistd.h>
#include <sys/mman.h>
#include <assert.h>
#include <unistd.h>
#include <sys/mman.h>
#include <assert.h>
-#include <config.h>
#include <urcu/compiler.h>
#include <ulimit.h>
#include <inttypes.h>
#include <common/defaults.h>
#include <common/common.h>
#include <urcu/compiler.h>
#include <ulimit.h>
#include <inttypes.h>
#include <common/defaults.h>
#include <common/common.h>
-#include <common/consumer.h>
-#include <common/consumer-timer.h>
+#include <common/consumer
/consumer
.h>
+#include <common/consumer
/consumer
-timer.h>
#include <common/compat/poll.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/utils.h>
#include <common/compat/poll.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/utils.h>
@@
-179,7
+177,7
@@
void *thread_manage_health(void *data)
sock = lttcomm_create_unix_sock(health_unix_sock_path);
if (sock < 0) {
ERR("Unable to create health check Unix socket");
sock = lttcomm_create_unix_sock(health_unix_sock_path);
if (sock < 0) {
ERR("Unable to create health check Unix socket");
-
ret
= -1;
+
err
= -1;
goto error;
}
goto error;
}
@@
-191,7
+189,7
@@
void *thread_manage_health(void *data)
if (ret < 0) {
ERR("Unable to set group on %s", health_unix_sock_path);
PERROR("chown");
if (ret < 0) {
ERR("Unable to set group on %s", health_unix_sock_path);
PERROR("chown");
-
ret
= -1;
+
err
= -1;
goto error;
}
goto error;
}
@@
-200,7
+198,7
@@
void *thread_manage_health(void *data)
if (ret < 0) {
ERR("Unable to set permissions on %s", health_unix_sock_path);
PERROR("chmod");
if (ret < 0) {
ERR("Unable to set permissions on %s", health_unix_sock_path);
PERROR("chmod");
-
ret
= -1;
+
err
= -1;
goto error;
}
}
goto error;
}
}
@@
-261,6
+259,11
@@
restart:
revents = LTTNG_POLL_GETEV(&events, i);
pollfd = LTTNG_POLL_GETFD(&events, i);
revents = LTTNG_POLL_GETEV(&events, i);
pollfd = LTTNG_POLL_GETFD(&events, i);
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/* Thread quit pipe has been closed. Killing thread. */
ret = check_health_quit_pipe(pollfd, revents);
if (ret) {
/* Thread quit pipe has been closed. Killing thread. */
ret = check_health_quit_pipe(pollfd, revents);
if (ret) {
@@
-270,7
+273,8
@@
restart:
/* Event on the registration socket */
if (pollfd == sock) {
/* Event on the registration socket */
if (pollfd == sock) {
- if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) {
+ if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)
+ && !(revents & LPOLLIN)) {
ERR("Health socket poll error");
goto error;
}
ERR("Health socket poll error");
goto error;
}
This page took
0.024412 seconds
and
4
git commands to generate.