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
- Avoid closing/interrupting the consumer while decoding is in flight; close gracefully
- Preserve the interrupt status and abort the current operation cleanly (the library already re-interrupts)
- Increase shutdown timeouts so workers finish before interruption
- Check for code in your app that interrupts client threads (Thread.interrupt, ExecutorService.shutdownNow)
- 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
- Close consumers gracefully and wait for in-flight decodes before shutdown
- Avoid ExecutorService.shutdownNow on threads running Pulsar client code
- Use timeouts at your own layer instead of interrupting client threads
- Keep schema fetches fast by ensuring broker reachability
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
- Can not enable for all producers but denies for replicators,
- Failed to add schema to an active topic with empty(BYTES) sc
- External schema is not compatible with the other schema type
- Only allowed to set schemaInfoForReplicator for a replicated
- payload (${payloadSize} bytes) cannot be decoded with schema
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/8a13023862502c1d.
Report an issue: GitHub.