[pull] master from kubernetes-client:master - #138
Merged
Conversation
WSClient.update() waits for the underlying socket to become readable via poll()/select() before reading a frame. SSL sockets decrypt an entire TLS record at a time, so when several websocket frames arrive in one TLS record, the first recv_data_frame() call consumes the whole record from the socket and the remaining frames sit decrypted inside the SSLSocket's internal buffer, where poll()/select() cannot see them. Those frames are only delivered once new data arrives on the connection and are lost if it never does, which randomly truncates large outputs read through the stream API. Check SSLSocket.pending() before polling, mirroring what PortForward._proxy() already does, so buffered frames are consumed without waiting for socket readability. The OPCODE_CONT handling suggested in the issue is not needed: websocket-client reassembles continuation frames inside recv_data_frame() and returns the opcode of the initial frame, so update() never observes OPCODE_CONT. A regression test documents that fragmented messages are delivered in full. Signed-off-by: Jojin <jojin.kb@gmail.com>
…ssl-pending Revert "Fix pending SSL data handling in stream client"
Fix WSClient.update dropping frames buffered in the SSL socket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )