pinpoint-apm/pinpoint · error · IllegalArgumentException

non-positive tieLength:<tieLength>

Error message

non-positive tieLength:<tieLength>

What it means

Constructor validation in LastRowWithTiesResultsExtractor: tieLength must be strictly positive because it caps how many tie rows are fetched beyond the limit. Zero or negative values make no sense, so the constructor throws IllegalArgumentException immediately.

Source

Thrown at commons-hbase/src/main/java/com/navercorp/pinpoint/common/hbase/LastRowWithTiesResultsExtractor.java:60

    private final int tieLength;

    @Nullable
    private final LastRowHandler<T> rowHandler;
    private final ToIntFunction<T> resultSizeHandler;

    public LastRowWithTiesResultsExtractor(RowMapper<T> rowMapper,
                                           int limit,
                                           int tieOffset,
                                           int tieLength,
                                           @Nullable LastRowHandler<T> rowHandler) {
        this.rowMapper = Objects.requireNonNull(rowMapper, "RowMapper");
        this.limit = limit;
        if (tieOffset < 0) {
            throw new IllegalArgumentException("negative tieOffset:" + tieOffset);
        }
        this.tieOffset = tieOffset;
        if (tieLength <= 0) {
            throw new IllegalArgumentException("non-positive tieLength:" + tieLength);
        }
        this.tieLength = tieLength;
        this.rowHandler = rowHandler;
        this.resultSizeHandler = resolveResultSizeHandler(rowMapper);
    }

    private ToIntFunction<T> resolveResultSizeHandler(RowMapper<T> rowMapper) {
        if (rowMapper instanceof RowTypeHint hint) {
            Class<?> clazz = hint.rowType();
            return ResultSizeHandlers.getHandler(clazz);
        }
        return new LazyResultSizeHandler<>();
    }

    @Override
    public List<T> extractData(ResultScanner results) throws Exception {
        final List<T> rs = new ArrayList<>();
        int rowNum = 0;

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Pass tieLength >= 1; remove the extractor and use a plain ResultsExtractor if you do not need tie rows
  2. Fix the config/property source that yields a non-positive tieLength
  3. Add Math.max(1, tieLength) only if your caller semantics allow silently coercing to 1

Example fix

// before
new LastRowWithTiesResultsExtractor<>(mapper, limit, 0, 0, handler);
// after
new LastRowWithTiesResultsExtractor<>(mapper, limit, 0, 10, handler);
Defensive patterns

Strategy: validation

Validate before calling

if (tieLength <= 0) throw new IllegalArgumentException("tieLength must be >= 1, got " + tieLength);

Prevention

When it happens

Trigger: Calling new LastRowWithTiesResultsExtractor<>(rowMapper, limit, tieOffset, tieLength, rowHandler) with tieLength <= 0, e.g. passing 0 to mean 'no ties' or a computed size that underflowed.

Common situations: Misconfigured tie/page-size properties resolving to 0; using -1 as an 'unlimited' sentinel where this class requires a positive count.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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