cds_lfht_for_each_entry(app->sessions->ht, &iter.iter, ua_sess,
node.node) {
ret = lttng_ht_del(app->sessions, &iter);
- assert(!ret);
+ if (ret) {
+ /* The session is already scheduled for teardown. */
+ continue;
+ }
delete_ust_app_session(app->sock, ua_sess);
}
lttng_ht_destroy(app->sessions);
continue;
}
ua_sess = lookup_session_by_app(usess, app);
- /* If ua_sess is NULL, there is a code flow error */
- assert(ua_sess);
+ if (!ua_sess) {
+ /* The application has problem or is probably dead. */
+ continue;
+ }
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *)uchan->name, &uiter);
continue;
}
ua_sess = lookup_session_by_app(usess, app);
- /* If ua_sess is NULL, there is a code flow error */
- assert(ua_sess);
+ if (!ua_sess) {
+ /* The application has problem or is probably dead. */
+ continue;
+ }
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *)uchan->name, &uiter);
continue;
}
ua_sess = lookup_session_by_app(usess, app);
- /* If ua_sess is NULL, there is a code flow error */
- assert(ua_sess);
+ if (!ua_sess) {
+ /* The application has problem or is probably dead. */
+ continue;
+ }
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *)uchan->name, &uiter);
}
ua_sess = caa_container_of(node, struct ust_app_session, node);
ret = lttng_ht_del(app->sessions, &iter);
- assert(!ret);
+ if (ret) {
+ /* Already scheduled for teardown. */
+ goto end;
+ }
+
obj.handle = ua_sess->handle;
obj.shm_fd = -1;
obj.wait_fd = -1;
}
ua_sess = lookup_session_by_app(usess, app);
- /* If ua_sess is NULL, there is a code flow error */
- assert(ua_sess);
+ if (!ua_sess) {
+ /* The application has problem or is probably dead. */
+ goto error;
+ }
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *)uchan->name, &iter);
}
ua_sess = lookup_session_by_app(usess, app);
- /* If ua_sess is NULL, there is a code flow error */
- assert(ua_sess);
+ if (!ua_sess) {
+ /* The application has problem or is probably dead. */
+ goto error;
+ }
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *)uchan->name, &iter);