apache/beam · info

Caught exception whilw trying to close append client. Ignori

Error message

Caught exception whilw trying to close append client. Ignoring

What it means

AppendClientInfo.close() attempts to close the BigQuery Storage Write StreamAppendClient via getCloseAppendClient().accept(client); any exception is deliberately swallowed with this (typo'd) warning, since close failures are harmless — the stream is abandoned anyway and the active-clients gauge is decremented. Note the typo 'whilw' is the library's own message text.

Source

Thrown at sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/AppendClientInfo.java:149

      String streamName = getStreamName.get();
      BigQueryServices.StreamAppendClient client =
          writeStreamService.getStreamAppendClient(
              streamName, getDescriptor(), useConnectionPool, missingValueInterpretation);

      activeStreamAppendClients.inc();

      return toBuilder().setStreamName(streamName).setStreamAppendClient(client).build();
    }
  }

  public void close() {
    BigQueryServices.StreamAppendClient client = getStreamAppendClient();
    if (client != null) {
      try {
        getCloseAppendClient().accept(client);
      } catch (Exception e) {
        // We ignore errors when closing clients.
        LOG.warn("Caught exception whilw trying to close append client. Ignoring", e);
      }
      activeStreamAppendClients.dec();
    }
  }

  @Memoized
  public byte[] getTableSchemaHash() {
    return TableRowToStorageApiProto.tableSchemaHash(getTableSchema());
  }

  boolean hasSchemaChanged(TableSchema updatedTableSchema) {
    return updatedTableSchema.hashCode() != getTableSchema().hashCode();
  }

  public ByteString encodeUnknownFields(TableRow unknown, boolean ignoreUnknownValues)
      throws TableRowToStorageApiProto.SchemaConversionException {
    Message msg =
        Preconditions.checkArgumentNotNull(

View on GitHub (pinned to 12126d8942)

Solutions

  1. No action needed: close errors are intentionally ignored and the client count is still decremented.
  2. If warnings are noisy at shutdown, drain/flush pipelines before stopping workers.
  3. Verify the stream was not already closed in your code path (avoid double-close of StreamAppendClient).
Defensive patterns

Strategy: try-catch

Try / catch

// library already swallows close errors; mirror this pattern in user code
try {
  client.close();
} catch (Exception e) {
  LOG.warn("close failed, ignoring", e);
}

Prevention

When it happens

Trigger: Any exception thrown while closing a Storage API append client during DoFn teardown — e.g. the underlying gRPC channel is already terminated, or the stream was closed server-side.

Common situations: Worker shutdown while stream was already DEAD/CLOSED; test pipelines ending with open streams; calling close twice; network unavailable at teardown.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/f3d42863a3f990b0. Report an issue: GitHub.