-
Notifications
You must be signed in to change notification settings - Fork 185
Refs. #151 -- detect binary payloads and send the correct opcode #152
Conversation
Welcome @sergei-maertens! |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/assign @mbohlool |
I'm not sure what the best way to test this is, without a real, functioning underlying websocket. The only test in edit: saw that CI handles this with downstream 👍 |
On Python 2, strings are bytestrings either way. On Python 3, the result of `chr(channel)` is `str`, while the data itself is `bytes`. The channel prefix needs to be turned into a binary type, and the websocket frame needs the correct opcode (binary vs. text). See #151 for the bug report and related issues.
What is needed to progress this PR? Anything I can do? |
channel_prefix = six.binary_type(channel_prefix, "ascii") | ||
|
||
payload = channel_prefix + data | ||
self.sock.send(payload, opcode=opcode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test case here that writes binary data?
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
It would be nice to have a working support for getting binary data from pods. |
/remove-lifecycle rotten |
@Ark-kun this change focus on writing binary data. Please open a separate issue if there is a problem with reading binary data. |
A testcase that demonstrates the fix would be nice. @sergei-maertens Are you still interested in this issue? |
Yes and no - from the business I don't have the time available to work on
this, and the whole process to get contributions merged or reviewed works
very demotivating. I get why the bot is set up the way it is, but it
doesn't make our contributions seem appreciated. It's a very lengthy and
demotivating process.
…On Tue, 11 Feb 2020, 23:31 Haowei Cai (Roy), ***@***.***> wrote:
A testcase that demonstrates the fix would be nice. @sergei-maertens
<https://github.com/sergei-maertens> Are you still interested in this
issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#152?email_source=notifications&email_token=ABKDJVRZF3V4D4CAWNOLHTTRCMRMZA5CNFSM4ILSUM6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELOLHHA#issuecomment-584889244>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKDJVRNVYQ75XZ44UICRSTRCMRMZANCNFSM4ILSUM6A>
.
|
I just realized that the e2e test I asked for in #152 (comment) belongs to a different repo. I agree in this case keeping python and python-base separate causes a bad contributor experience. @sergei-maertens I'm sorry for the confusion. I'm still not comfortable getting this bug fix in without a test, but the test and the bug being in two repos means we cannot merge them in the same time. Given the behavior change is well scoped, and the original bytes behavior is broken. I will merge this change and open an issue to track adding a test. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: roycaihw, sergei-maertens The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
On Python 2, strings are bytestrings either way. On Python 3, the
result of
chr(channel)
isstr
, while the data itself isbytes
. The channel prefix needs to be turned into a binary type,and the websocket frame needs the correct opcode (binary vs. text).
See #151 for the bug report and related issues.
This is basically the same fix as #52 but with a different approach and passes the
opcode
argument to indicate a binary frame.