Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] CallOptionsConfig.setUseTimeout also affects streaming RPCs #2784

Open
AdamBSteele opened this issue Dec 29, 2020 · 0 comments
Open
Labels
api: bigtable Issues related to the googleapis/java-bigtable-hbase API. type: docs Improvement to the documentation for an API.

Comments

@AdamBSteele
Copy link
Contributor

AdamBSteele commented Dec 29, 2020

The documentation for CallOptionsConfig.Builder.setUseTimeout() states that setUseTimeout only affects "unary RPCS like mutations." Per my testing, it also affects (streaming) readRows operations.

Environment details

Version(s): java-bigtable-hbase v1.18.1

Steps to reproduce

(See code below)

  1. Start emulator with latency injection
  • I used this fork to introduce 50ms latency to all ReadRows calls with command line arg: --inject-latency="ReadRows:p0:50ms"
  1. In CallOptionsConfig:
  • Set useTimeout = false.
  • Use short values for ReadRowsRpcAttemptTimeoutMs and ReadRowsRpcTimeoutMs.
  1. Call readRows

Results

  • Expected: Calls will throw timeouts
  • Actual: Calls will succeed.

Note: if you set usetTimeout = true, you will see timeouts

Code example

    final CallOptionsConfig callOptions = CallOptionsConfig.builder()
        .setReadRowsRpcAttemptTimeoutMs(10) // Short
        .setReadRowsRpcTimeoutMs(10) // Short
        .setUseTimeout(false) // If you set this to true, you'll see timeouts.
        .build();
    final BigtableOptions bigtableOptions = BigtableOptions.builder()
        .enableEmulator("localhost:9000")
        .setCallOptionsConfig(callOptions)
        .setInstanceId("example")
        .setProjectId("example")
        .setUserAgent("example")
        .build();
    final BigtableSession session = new BigtableSession(bigtableOptions);

    // Create table
    session.getTableAdminClient().createTable(CreateTableRequest.newBuilder().setTableId("tbl").build());

    // Scan table
    System.out.println("This stream operation should timeout");
    session.getDataClient().readRows(
        ReadRowsRequest.newBuilder().setTableName("/tables/tbl").build()
    ).next(10_000);
    System.out.println("Operation succeeded");

External references such as API reference guides

javadoc: CallOptionsConfig.Builder

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/java-bigtable-hbase API. label Dec 29, 2020
@kolea2 kolea2 added the type: docs Improvement to the documentation for an API. label Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/java-bigtable-hbase API. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

No branches or pull requests

2 participants