pinpoint-apm/pinpoint · error · IllegalArgumentException
Illegal report period:
Error message
Illegal report period:
What it means
DefaultChannelzScheduledReporter schedules gRPC channelz metrics reporting at a fixed period; the constructor converts the Duration to millis and rejects non-positive values with IllegalArgumentException. A non-positive period cannot be scheduled and indicates a configuration error.
Source
Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/sender/grpc/metric/DefaultChannelzScheduledReporter.java:32
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
public class DefaultChannelzScheduledReporter implements ChannelzScheduledReporter {
private static final long REPORT_INITIAL_DELAY_MS = 1000;
private final Logger logger = LogManager.getLogger(this.getClass());
private final ConcurrentMap<Long, ChannelzReporter> reporterMap = new ConcurrentHashMap<>();
private final ScheduledExecutorService scheduledExecutorService = newScheduledExecutorService();
private final long reportPeriodMillis;
public DefaultChannelzScheduledReporter(Duration reportPeriod) {
Objects.requireNonNull(reportPeriod, "reportPeriod");
this.reportPeriodMillis = reportPeriod.toMillis();
if (this.reportPeriodMillis <= 0) {
throw new IllegalArgumentException("Illegal report period: " + reportPeriod);
}
}
private static ScheduledExecutorService newScheduledExecutorService() {
String threadName = PinpointThreadFactory.DEFAULT_THREAD_NAME_PREFIX +
DefaultChannelzScheduledReporter.class.getSimpleName();
ThreadFactory threadFactory = new PinpointThreadFactory(threadName, true);
return new ScheduledThreadPoolExecutor(1, threadFactory);
}
@Override
public void registerRootChannel(final long id, final ChannelzReporter reporter) {
Objects.requireNonNull(reporter, "reporter");
final ChannelzReporter old = reporterMap.putIfAbsent(id, reporter);
if (old != null) {
return;
}
scheduledExecutorService.scheduleAtFixedRate(new Runnable() {View on GitHub (pinned to 744c3d3075)
Solutions
- Set the report period config to a positive duration (e.g. 60s)
- Disable channelz reporting via its feature flag instead of a zero period
- Check duration parsing/unit configuration so the value is not truncated to 0
Example fix
// before profiler.channelz.report.period=0 // after profiler.channelz.report.period=60s
Defensive patterns
Strategy: validation
Validate before calling
Duration d = Duration.parse(props.getProperty("profiler.channelz.report.period"));
if (d.isZero() || d.isNegative()) throw new IllegalArgumentException("channelz report period must be positive, got " + d); Type guard
boolean isValidReportPeriod(Duration d) { return d != null && !d.isZero() && !d.isNegative(); } Try / catch
try { reporter = new DefaultChannelzScheduledReporter(period); } catch (IllegalArgumentException e) { log.error("Bad channelz report period: {}", e.getMessage()); } Prevention
- Configure positive durations with explicit time units (e.g. 60s)
- Disable channelz via its feature flag rather than a zero period
- Validate duration parsing to catch unit mistakes that truncate to 0
When it happens
Trigger: Constructing new DefaultChannelzScheduledReporter(Duration.ZERO), a negative Duration, or a duration resolving to <= 0 millis from config (e.g. profiler.channelz.period=0).
Common situations: Config placeholder defaulting to 0, user setting 0 intending to disable channelz reporting (should disable the feature instead), or a unit-conversion bug producing a sub-millisecond duration.
Related errors
- Unknown AgentType:
- Failed to detect pinpoint profile. Please add -Dpinpoint.act
- unsupported profile or profile alias:
- %s load fail Caused by:%s
- list size not same
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/638b6fd53e641b58.
Report an issue: GitHub.