pinpoint-apm/pinpoint · warning

metadataDataSender close fail

Error message

metadataDataSender close fail

What it means

GrpcModuleLifeCycle.shutdown() closes each gRPC data sender via IOUtils.closeQuietly; when metadataDataSender.close() throws (e.g. the underlying gRPC channel/stream fails to terminate cleanly), the exception is passed to the warning callback which logs "metadataDataSender close fail". It is a non-fatal shutdown-time warning: the profiler still shuts down, but the metadata sender's resources (channel, executor) may not have been released cleanly.

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/module/GrpcModuleLifeCycle.java:112

        this.statDataSender = this.statDataSenderProvider.get();
        logger.info("statDataSenderProvider:{}", statDataSender);

        this.dnsExecutorService = dnsExecutorServiceProvider.get();
        logger.info("dnsExecutorServiceProvider:{}", dnsExecutorService);

        this.reconnectScheduledExecutorService = reconnectScheduledExecutorProvider.get();
        logger.info("reconnectScheduledExecutorServiceProvider:{}", reconnectScheduledExecutorService);

    }

    @Override
    public void shutdown() {
        logger.info("shutdown()");
        IOUtils.closeQuietly(spanDataSender, (ex) -> logger.warn("spanDataSender close fail", ex));
        IOUtils.closeQuietly(statDataSender, (ex) -> logger.warn("statDataSender close fail", ex));
        IOUtils.closeQuietly(agentDataSender, (ex) -> logger.warn("agentDataSender close fail", ex));
        IOUtils.closeQuietly(metadataDataSender, (ex) -> logger.warn("metadataDataSender close fail", ex));

        if (dnsExecutorService != null) {
            if (!MoreExecutors.shutdownAndAwaitTermination(dnsExecutorService, Duration.ofSeconds(3))) {
                logger.warn("dnsExecutor shutdown failed");
            }
        }
        if (reconnectScheduledExecutorService != null) {
            if (!MoreExecutors.shutdownAndAwaitTermination(reconnectScheduledExecutorService, Duration.ofSeconds(3))) {
                logger.warn("reconnectScheduledExecutor shutdown failed");
            }
        }
        IOUtils.closeQuietly(reporter, (ex) -> logger.warn("reporter close fail", ex));
    }

    @Override
    public String toString() {
        return "GrpcModuleLifeCycle{" +
                ", agentDataSender=" + agentDataSender +

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Check the logged cause exception below this warning; if it's a channel shutdown timeout, verify the collector address/port and network before shutdown.
  2. Ensure the profiler is started normally so metadataDataSender is a fully-initialized sender (not null/half-built); reinitialize with -Dpinpoint.profiler.test=false or proper collector config.
  3. Upgrade Pinpoint — newer releases hardened Sender close/shutdown paths in GrpcModuleLifeCycle.
  4. If the warning only appears at JVM exit and metadata was already flushed, it can be safely ignored.

Example fix

// before: collector host unreachable at shutdown -> warning
profiler.collector.span.ip=wrong-host
// after
profiler.collector.span.ip=collector.pinpoint.local
Defensive patterns

Strategy: try-catch

Try / catch

// This warning is internal to Pinpoint; guard the shutdown path in host code
try {
    lifeCycle.shutdown();
} catch (Exception e) {
    logger.warn("profiler module shutdown incomplete", e); // never block JVM exit
}

Prevention

When it happens

Trigger: Calling GrpcModuleLifeCycle.shutdown() (agent stop, JVM shutdown hook, module restart) while the metadataDataSender's gRPC channel is in a bad state — e.g. already disconnected, mid-reconnect, or its close() implementation throws (UncaughtExceptionHandler / channel shutdown failure).

Common situations: Agent stopping while the collector is unreachable; network drop during shutdown causing the gRPC channel's awaitTermination to fail; abrupt collector restart racing with agent shutdown; unit/integration tests tearing down the profiler module with mocked or half-initialized senders.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/a7a4c53a6608daf1. Report an issue: GitHub.