Skip to content

Comments

fix: fall back to HTTP/1.1 when global http2 option is enabled#3894

Closed
Deeven-Seru wants to merge 2 commits intogoogleapis:mainfrom
Deeven-Seru:fix/3418-disable-http2-global-option
Closed

fix: fall back to HTTP/1.1 when global http2 option is enabled#3894
Deeven-Seru wants to merge 2 commits intogoogleapis:mainfrom
Deeven-Seru:fix/3418-disable-http2-global-option

Conversation

@Deeven-Seru
Copy link

Summary

This change mitigates hanging requests reported in #3418 when google.options({http2: true}) is used.

Root cause

The hang occurs in the HTTP/2 request path (googleapis-common) where some GET requests can remain open indefinitely. Since this repo surfaces that path through global options, affected calls appear to hang forever.

What changed

  • Added normalization of global options in GoogleApis.options().
  • If http2: true is provided globally, emit a warning and force http2: false (HTTP/1.1 fallback).
  • Preserved all other global options unchanged.
  • Added tests to verify fallback behavior and warning emission.

Tests

  • npx mocha build/test/test.options.js --grep "disable http2|not emit warning"
  • npx mocha build/test/test.options.js

Notes

This is a defensive mitigation in google-api-nodejs-client until a full HTTP/2 transport fix is available downstream.

@Deeven-Seru Deeven-Seru requested a review from a team as a code owner February 12, 2026 15:59
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Feb 12, 2026
@quirogas
Copy link
Contributor

HI @DEVELOPER-DEEVEN , thank you for taking a swing at this bug. unfortunately, the code you are modifying is autogenerated, so the change has to happen upstream. Additionally, falling back to http/1.1 comes with it's own set of security concerns, so we would probably want to implement a more secure fall back.

@quirogas quirogas closed this Feb 13, 2026
@Deeven-Seru
Copy link
Author

Thanks for the clarification @quirogas . I missed that these files were autogenerated—makes total sense why this can't be merged here.
Regarding the HTTP/1.1 fallback, I understand the security/stability implications of a global downgrade. I'll look into googleapis-common or the upstream generator to see if there's a safer way to handle the hanging request timeouts without forcing a protocol downgrade.
Thanks for the review!

@Deeven-Seru Deeven-Seru deleted the fix/3418-disable-http2-global-option branch February 14, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants