prestodb/presto · error · IllegalArgumentException
shuffleWriteInfo and broadcastBasePath can not be specified
Error message
shuffleWriteInfo and broadcastBasePath can not be specified in same request
What it means
BatchTaskUpdateRequest's constructor enforces a mutual-exclusion invariant: an HTTP batch task update may carry either shuffle write info OR a broadcast base path, never both. Both Optional fields being present is an invalid request and fails fast with IllegalArgumentException.
Source
Thrown at presto-spark-base/src/main/java/com/facebook/presto/spark/execution/http/BatchTaskUpdateRequest.java:45
public final class BatchTaskUpdateRequest
{
private final TaskUpdateRequest taskUpdateRequest;
private final Optional<String> shuffleWriteInfo;
private final Optional<String> broadcastBasePath;
@JsonCreator
public BatchTaskUpdateRequest(
@JsonProperty("taskUpdateRequest") TaskUpdateRequest taskUpdateRequest,
@JsonProperty("shuffleWriteInfo") Optional<String> shuffleWriteInfo,
@JsonProperty("broadcastBasePath") Optional<String> broadcastBasePath)
{
this.taskUpdateRequest = requireNonNull(taskUpdateRequest, "taskUpdateRequest is null");
this.shuffleWriteInfo = requireNonNull(shuffleWriteInfo, "shuffleWriteInfo is null");
this.broadcastBasePath = requireNonNull(broadcastBasePath, "broadcastBasePath is null");
// shuffleWriteInfo and broadcastBasePath, both can't have value at the same time.
if (this.shuffleWriteInfo.isPresent() && this.broadcastBasePath.isPresent()) {
throw new IllegalArgumentException("shuffleWriteInfo and broadcastBasePath can not be specified in same request");
}
}
@JsonProperty
public TaskUpdateRequest getTaskUpdateRequest()
{
return taskUpdateRequest;
}
@JsonProperty
public Optional<String> getShuffleWriteInfo()
{
return shuffleWriteInfo;
}
@JsonProperty
public Optional<String> getBroadcastBasePath()
{View on GitHub (pinned to 55bb57d202)
Solutions
- Send exactly one of shuffleWriteInfo or broadcastBasePath per update request
- Fix the client/request builder to choose the distribution mode appropriate for the task output
- Validate the request payload JSON before sending and drop the unused field
- Check for version skew between the client and the Presto-on-Spark server protocol
Example fix
// before new BatchTaskUpdateRequest(taskUpdateRequest, Optional.of(shuffleWriteInfo), Optional.of(broadcastBasePath)); // after new BatchTaskUpdateRequest(taskUpdateRequest, Optional.of(shuffleWriteInfo), Optional.empty());
Defensive patterns
Strategy: validation
Validate before calling
if (shuffleWriteInfo.isPresent() && broadcastBasePath.isPresent()) {
throw new IllegalArgumentException("send only one of shuffleWriteInfo/broadcastBasePath");
} Type guard
boolean isValidBatchUpdate(Optional<?> shuffleWriteInfo, Optional<?> broadcastBasePath) {
return !(shuffleWriteInfo.isPresent() && broadcastBasePath.isPresent());
} Try / catch
try {
new BatchTaskUpdateRequest(taskUpdateRequest, shuffleWriteInfo, broadcastBasePath);
}
catch (IllegalArgumentException e) {
if (e.getMessage().contains("shuffleWriteInfo and broadcastBasePath")) {
// rebuild request with only one field set
}
throw e;
} Prevention
- Build requests through a helper that enforces one-of semantics
- Validate JSON payloads against a schema with oneOf constraints
- Pin client/server protocol versions to avoid skew
- Unit-test request builders for both distribution modes
When it happens
Trigger: Constructing BatchTaskUpdateRequest with both shuffleWriteInfo and broadcastBasePath non-empty — e.g. a client (or HTTP server deserializer) populating both fields in the same update payload.
Common situations: Buggy custom HTTP task clients sending both fields; deserialization of legacy/malformed JSON containing both properties; mixing shuffle-based and broadcast-based result distribution in one request.
Related errors
- Unexpected partitioning:
- Error reading response from server
- Expected response code to be 200, but was %s:%n%s
- %s header is not set: %s
- Expected %s response from server but got %s
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/a8f521c7e2d8ff6f.
Report an issue: GitHub.