X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-thread.c;h=552b7ddd8176a6a246fd90168189dce3dd691aba;hp=76d6ef99da84d31c77f89ef02de72d18931940f6;hb=d88aee689d5bd0067f362a323cb69c37717df59f;hpb=d0b96690836f4b876096f3dc14801f8e25281a77 diff --git a/src/bin/lttng-sessiond/ust-thread.c b/src/bin/lttng-sessiond/ust-thread.c index 76d6ef99d..552b7ddd8 100644 --- a/src/bin/lttng-sessiond/ust-thread.c +++ b/src/bin/lttng-sessiond/ust-thread.c @@ -128,24 +128,20 @@ restart: goto error; } - ret = close(pollfd); - if (ret < 0) { - PERROR("close sock %d", pollfd); - } - lttng_fd_put(LTTNG_FD_APPS, 1); + /* The socket is closed after a grace period here. */ + ust_app_notify_sock_unregister(pollfd); } else if (revents & (LPOLLIN | LPOLLPRI)) { ret = ust_app_recv_notify(pollfd); if (ret < 0) { - ret = lttng_poll_del(&events, pollfd); - if (ret < 0) { - goto error; - } - - ret = close(pollfd); - if (ret < 0) { - PERROR("close sock %d", pollfd); - } - lttng_fd_put(LTTNG_FD_APPS, 1); + /* + * If the notification failed either the application is + * dead or an internal error happened. In both cases, + * we can only continue here. If the application is + * dead, an unregistration will follow or else the + * application will notice that we are not responding + * on that socket and will close it. + */ + continue; } } else { ERR("Unknown poll events %u for sock %d", revents, pollfd);