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

gRPC: hang on first request when using GrpcStorageOptions.setAttemptDirectPath(true) and GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS=true #1737

Closed
BenWhitehead opened this issue Oct 26, 2022 · 3 comments
Labels
api: storage Issues related to the googleapis/java-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@BenWhitehead
Copy link
Collaborator

Affected version(s): 2.14.0+

There is a noticeable hang (several seconds) for the first request from the client when using directPath XDS. After the initial hang it doesn't seem to be an issue.

@BenWhitehead BenWhitehead added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 26, 2022
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Oct 26, 2022
@BenWhitehead BenWhitehead changed the title gRPC: hand on first request when using GrpcStorageOptions.setAttemptDirectPath(true) and GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS=true gRPC: hang on first request when using GrpcStorageOptions.setAttemptDirectPath(true) and GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS=true Oct 26, 2022
@tritone tritone added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 27, 2023
@BenWhitehead
Copy link
Collaborator Author

Minimized Repro (using com.google.cloud:google-cloud-storage:2.17.2)

package x;

import com.google.cloud.storage.Blob;
import com.google.cloud.storage.BlobId;
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.StorageOptions;
import com.google.common.base.Stopwatch;

final class Main {
  public static void main(String[] args)
      throws Exception {
    try (Storage s = StorageOptions.grpc().setAttemptDirectPath(true).build().getService()) {
      BlobId id = BlobId.fromGsUtilUri(args[0]);
      doGet(s, id);
      doGet(s, id);
      doGet(s, id);
    }
  }

  private static void doGet(Storage s, BlobId id) {
    Stopwatch sw = Stopwatch.createStarted();
    Blob blob = s.get(id);
    Stopwatch stop = sw.stop();
    System.out.println("Fetching object metadata took " + stop);
  }
}

Results

Fetching object metadata took 10.36 s
Fetching object metadata took 43.23 ms
Fetching object metadata took 36.63 ms

@BenWhitehead
Copy link
Collaborator Author

Repro in repo form: https://github.com/BenWhitehead/dp-hang-debug

@BenWhitehead
Copy link
Collaborator Author

Fixed in grpc 1.54.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants