Skip to content

Main application hangs if it initializes a KafkaProducer with sentry-java 6.19.1 #2744

@tjerkw

Description

@tjerkw

Integration

sentry

Java Version

eclipse-temurin:11-jre

Version

6.19.1 upwards

Steps to Reproduce

Build this file with sentry-sdk 6.19.1:

import org.apache.kafka.clients.producer.KafkaProducer

class ReproduceSentryIssue {
    private val kafkaProducer: KafkaProducer<String, String> =
        KafkaProducer(...)

    companion object {

        @JvmStatic
        fun main(args: Array<String>) {
             ReproduceSentryIssue()
        }
    }
}

Run it with a logback appender:

    <!-- Configure the Sentry appender, overriding the logging threshold to the WARN level -->
    <appender name="Sentry" class="io.sentry.logback.SentryAppender">
        <!-- Optionally change minimum Event level. Default for Events is ERROR -->
        <minimumEventLevel>WARN</minimumEventLevel>
        <!-- Optionally change minimum Breadcrumbs level. Default for Breadcrumbs is INFO -->
        <minimumBreadcrumbLevel>INFO</minimumBreadcrumbLevel>
    </appender>

Run it on docker image FROM eclipse-temurin:11-jre

Result:

  • Main application never exists, it never returns.

Workaround: Downgrade to 6.18.1

Note: Also reproducable with 6.20.1

Expected Result

The application should cleanly exit

Actual Result

It hangs, only stops with CTRL-C

Metadata

Metadata

Assignees

Labels

BugIssue type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions