apache/pulsar · warning · SerializationException

Interrupted at fetching schema info for <SchemaUtils.getStri

Error message

Interrupted at fetching schema info for <SchemaUtils.getStringSchemaVersion(schemaVersion)>

What it means

getSchemaInfoByVersion blocks on the CompletableFuture from schemaInfoProvider.getSchemaByVersion(...).get(). If that waiting thread is interrupted, the interrupt flag is restored and a SerializationException 'Interrupted at fetching schema info for <version>' is thrown. It means schema lookup was cancelled by thread shutdown or interruption, not a schema problem itself.

Source

Thrown at pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/reader/AbstractMultiVersionReader.java:125

    }

    /**
     * Load the schema reader for reading messages encoded by the given schema version.
     *
     * @param schemaVersion the provided schema version
     * @return the schema reader for decoding messages encoded by the provided schema version.
     */
    protected abstract SchemaReader<T> loadReader(BytesSchemaVersion schemaVersion);

    /**
     * TODO: think about how to make this async.
     */
    protected SchemaInfo getSchemaInfoByVersion(byte[] schemaVersion) {
        try {
            return schemaInfoProvider.getSchemaByVersion(schemaVersion).get();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new SerializationException(
                    "Interrupted at fetching schema info for " + SchemaUtils.getStringSchemaVersion(schemaVersion),
                    e
            );
        } catch (ExecutionException e) {
            throw new SerializationException(
                    "Failed at fetching schema info for " + SchemaUtils.getStringSchemaVersion(schemaVersion),
                    e.getCause()
            );
        }
    }
}

View on GitHub (pinned to 820761864e)

Solutions

  1. Avoid closing/interrupting the consumer while decoding is in flight; close gracefully
  2. Preserve the interrupt status and abort the current operation cleanly (the library already re-interrupts)
  3. Increase shutdown timeouts so workers finish before interruption
  4. Check for code in your app that interrupts client threads (Thread.interrupt, ExecutorService.shutdownNow)
  5. Retry the operation on a fresh, non-interrupted thread if appropriate

Example fix

// before
executor.shutdownNow(); // interrupts in-flight schema fetch -> SerializationException
// after
executor.shutdown();
if (!executor.awaitTermination(30, TimeUnit.SECONDS)) {
    executor.shutdownNow();
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (Thread.currentThread().isInterrupted()) {
    // do not start schema fetch; abort current decode gracefully
    return null;
}

Type guard

null

Try / catch

try {
    SchemaInfo info = reader.getSchemaInfoByVersion(version);
} catch (SerializationException e) {
    if (Thread.currentThread().isInterrupted()) {
        // shutdown in progress: stop work, do not swallow interrupt
        throw e;
    }
    // otherwise retry on a clean thread
}

Prevention

When it happens

Trigger: Calling getSchemaInfoByVersion (used inside read paths) while the calling thread is interrupted — e.g. consumer closed during decode, executor shutdown, or application shutdown interrupting schema fetch.

Common situations: Shutting down consumers/producers while messages are still being decoded; timeouts that cancel/interrupt worker threads; test frameworks interrupting threads; long schema fetches interrupted by user-initiated close.

Related errors


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/8a13023862502c1d. Report an issue: GitHub.