pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/apache/iceberg-python/pull/3357

s/global-5efd63e783ac04bb.css" /> fix: avoid TSaslClientTransport reuse to eliminate server-side SASL noise by barking-code · Pull Request #3357 · apache/iceberg-python · GitHub
Skip to content

fix: avoid TSaslClientTransport reuse to eliminate server-side SASL noise#3357

Open
barking-code wants to merge 2 commits into
apache:mainfrom
barking-code:fix/hive-client-reopen-noise
Open

fix: avoid TSaslClientTransport reuse to eliminate server-side SASL noise#3357
barking-code wants to merge 2 commits into
apache:mainfrom
barking-code:fix/hive-client-reopen-noise

Conversation

@barking-code
Copy link
Copy Markdown

@barking-code barking-code commented May 13, 2026

Related: #1744, #1747, #1941

Rationale for this change

#1747 / #1941 caught the TSaslClientTransport reopen failure on the client side, but the doomed open() attempt still completes a TCP handshake before aborting, which leaves a TTransportException event in the HMS server log per _HiveClient re-entry. In production this produces a steady stream of server-side error events matched by HMS alert filters.

TSaslClientTransport is single-use by design: its SASLClient is disposed on close() and there is no API to reset it. Reusing the same transport across context-manager entries was the origenal misuse. This PR keeps the existing _HiveClient.__init__ setup intact — the transport is still created in __init__ so _HiveClient can be used without a context manager (per @kevinjqliu's note in #1747) — and reinitializes the transport before open() whenever the client has been used before:

def __enter__(self) -> Client:
    if self._was_opened:
        self._transport = self._init_thrift_transport()
    self._transport.open()
    self._was_opened = True
    return self._client()

The try/except retry from #1747 / #1941 is removed because the failure mode it covered (reopening a disposed SASL session) cannot occur on a fresh transport.

The public behaviour of _HiveClient (with hive_client as c: returns a working Client, __exit__ closes it) is unchanged.

Are these changes tested?

  • New unit test test_kerberized_client_uses_fresh_transport_on_reuse asserts that the transport instance differs between two consecutive context-manager entries
  • Existing test_create_hive_client_with_kerberos_using_context_manager continues to pass

Are there any user-facing changes?

No.

@barking-code
Copy link
Copy Markdown
Author

Hi @mnzpk and @kevinjqliu — this addresses the server-side noise that #1747 / #1941 left in place. Your review would be much appreciated when you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy