projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: remove wrong doing asserts in sessiond
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index 6b1035c34c13ab11a8eec2d0fdc29cf6c0021f00..093a2fb31305e83b1a14c9cd6b807a90eb2ff8f3 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-1355,6
+1355,9
@@
error_testpoint:
* Send a socket to a thread This is called from the dispatch UST registration
* thread once all sockets are set for the application.
*
* Send a socket to a thread This is called from the dispatch UST registration
* thread once all sockets are set for the application.
*
+ * The sock value can be invalid, we don't really care, the thread will handle
+ * it and make the necessary cleanup if so.
+ *
* On success, return 0 else a negative value being the errno message of the
* write().
*/
* On success, return 0 else a negative value being the errno message of the
* write().
*/
@@
-1362,9
+1365,14
@@
static int send_socket_to_thread(int fd, int sock)
{
int ret;
{
int ret;
- /* Sockets MUST be set or else this should not have been called. */
- assert(fd >= 0);
- assert(sock >= 0);
+ /*
+ * It's possible that the FD is set as invalid with -1 concurrently just
+ * before calling this function being a shutdown state of the thread.
+ */
+ if (fd < 0) {
+ ret = -EBADF;
+ goto error;
+ }
do {
ret = write(fd, &sock, sizeof(sock));
do {
ret = write(fd, &sock, sizeof(sock));
@@
-1627,7
+1635,12
@@
static void *thread_dispatch_ust_registration(void *data)
if (ret < 0) {
rcu_read_unlock();
session_unlock_list();
if (ret < 0) {
rcu_read_unlock();
session_unlock_list();
- /* No notify thread, stop the UST tracing. */
+ /*
+ * No notify thread, stop the UST tracing. However, this is
+ * not an internal error of the this thread thus setting
+ * the health error code to a normal exit.
+ */
+ err = 0;
goto error;
}
goto error;
}
@@
-1652,7
+1665,12
@@
static void *thread_dispatch_ust_registration(void *data)
if (ret < 0) {
rcu_read_unlock();
session_unlock_list();
if (ret < 0) {
rcu_read_unlock();
session_unlock_list();
- /* No apps. thread, stop the UST tracing. */
+ /*
+ * No apps. thread, stop the UST tracing. However, this is
+ * not an internal error of the this thread thus setting
+ * the health error code to a normal exit.
+ */
+ err = 0;
goto error;
}
goto error;
}
This page took
0.023829 seconds
and
4
git commands to generate.