Skip to content

Commit 05f8c96

Browse files
committed
rlm_kafka: use the cached log_prefix in the self-pipe error cb
_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.
1 parent ffad24d commit 05f8c96

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/modules/rlm_kafka/rlm_kafka.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,11 @@ static void _kafka_fd_readable(UNUSED fr_event_list_t *el, int fd, UNUSED int fl
296296
* @param[in] fd_errno errno as reported by the event loop.
297297
* @param[in] uctx UNUSED.
298298
*/
299-
static void _kafka_fd_error(UNUSED fr_event_list_t *el, int fd, UNUSED int flags, int fd_errno, UNUSED void *uctx)
299+
static void _kafka_fd_error(UNUSED fr_event_list_t *el, int fd, UNUSED int flags, int fd_errno, void *uctx)
300300
{
301-
FATAL("kafka - self-pipe error (fd=%d): %s", fd, fr_syserror(fd_errno));
301+
rlm_kafka_thread_t *t = talloc_get_type_abort(uctx, rlm_kafka_thread_t);
302+
303+
FATAL("%s - self-pipe error (fd=%d): %s", t->inst->log_prefix, fd, fr_syserror(fd_errno));
302304
}
303305

304306
/** Translate a librdkafka delivery-report error into a module rcode

0 commit comments

Comments
 (0)