+ /*
+ * Instantaneous sampling of the session id if present.
+ *
+ * This method is preferred over `sessiond_find_by_name` then
+ * fetching the session'd id since `sessiond_find_by_name`
+ * requires the session list lock to be taken.
+ *
+ * Taking the session list lock can lead to a deadlock
+ * between the action executor and the notification thread
+ * (caller of add_action_to_subitem_array). It is okay if the
+ * session state changes between the enqueuing time and the
+ * execution time. The execution context is validated at
+ * execution time.
+ */
+ if (sample_session_id_by_name(session_name, &session_id)) {