bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Add support to allow credential helper to return of JSON payloads larger than 4K

Open RiverPup opened this issue 1 year ago • 1 comments

Description of the feature request:

It seems that the current implementation of credential helper only works for the return of JSON payloads less than 4K. JSON payloads larger than 4K will cause the credential helper call to hang and timeout.

Which category does this issue belong to?

CLI, Remote Execution

What underlying problem are you trying to solve with this feature?

Credential helper JSON payloads greater than 4K are timing out.

Which operating system are you running Bazel on?

Windows and Linux

What is the output of bazel info release?

version 6.3.1 to 7.x

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

RiverPup avatar Feb 10 '24 19:02 RiverPup

The issue here is that Bazel reads the credential helper output from a pipe, and we don't start reading from the pipe until the process terminates. So if the response is too big to fit in the pipe buffer, we deadlock and timeout.

I can think of two possible fixes: increase the size of the pipe buffer or read the response in a separate thread that does its own buffering. Either way, we definitely want to cap the response size at some sane value (say, 64KB).

tjgq avatar May 15 '24 19:05 tjgq