Skip to content

Commit

Permalink
Use grpc metadata limit from Admin (flyteorg#2359)
Browse files Browse the repository at this point in the history
Admin already gates large error messages, but flytekit does not set the max metadata size. The default is 16KB, so now we're bumping it up to roughly 32KB, in line with the cutoff from Admin.

Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor authored Apr 19, 2024
1 parent b0cd1e8 commit f116831
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flytekit/clients/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ def __init__(self, cfg: PlatformConfig, **kwargs):
url: The server address.
insecure: if insecure is desired
"""
# Set the value here to match the limit in Admin, otherwise the client will cut off and the user gets a
# StreamRemoved exception.
# https://github.com/flyteorg/flyte/blob/e8588f3a04995a420559327e78c3f95fbf64dc01/flyteadmin/pkg/common/constants.go#L14
options = (("grpc.max_metadata_size", 32000),)
self._cfg = cfg
self._channel = wrap_exceptions_channel(
cfg, upgrade_channel_to_authenticated(cfg, upgrade_channel_to_proxy_authenticated(cfg, get_channel(cfg)))
cfg,
upgrade_channel_to_authenticated(
cfg, upgrade_channel_to_proxy_authenticated(cfg, get_channel(cfg, options=options))
),
)
self._stub = _admin_service.AdminServiceStub(self._channel)
self._signal = signal_service.SignalServiceStub(self._channel)
Expand Down

0 comments on commit f116831

Please sign in to comment.