]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rlm_kafka: use the cached log_prefix in the self-pipe error cb
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 22 Apr 2026 17:13:43 +0000 (13:13 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 23 Apr 2026 17:58:15 +0000 (13:58 -0400)
_kafka_fd_error was hard-coding the literal "kafka" prefix.  Pull the
thread context off the event's uctx and format against the same
"rlm_kafka (<instance>)" prefix the rest of the module uses, so
multi-instance configurations show which instance's self-pipe fell
over.

src/modules/rlm_kafka/rlm_kafka.c

index 47e88b2137ab3808aaea227a83e65b8e5aa5749a..171ba13227eca647821a1741e5af707c61faf7ad 100644 (file)
@@ -296,9 +296,11 @@ static void _kafka_fd_readable(UNUSED fr_event_list_t *el, int fd, UNUSED int fl
  * @param[in] fd_errno errno as reported by the event loop.
  * @param[in] uctx     UNUSED.
  */
-static void _kafka_fd_error(UNUSED fr_event_list_t *el, int fd, UNUSED int flags, int fd_errno, UNUSED void *uctx)
+static void _kafka_fd_error(UNUSED fr_event_list_t *el, int fd, UNUSED int flags, int fd_errno, void *uctx)
 {
-       FATAL("kafka - self-pipe error (fd=%d): %s", fd, fr_syserror(fd_errno));
+       rlm_kafka_thread_t      *t = talloc_get_type_abort(uctx, rlm_kafka_thread_t);
+
+       FATAL("%s - self-pipe error (fd=%d): %s", t->inst->log_prefix, fd, fr_syserror(fd_errno));
 }
 
 /** Translate a librdkafka delivery-report error into a module rcode