You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by GitBox <gi...@apache.org> on 2022/06/09 00:26:53 UTC
[GitHub] [thrift] MikaelSmith opened a new pull request, #2620: THRIFT-5595: Avoid peek request with SSLSocket
MikaelSmith opened a new pull request, #2620:
URL: https://github.com/apache/thrift/pull/2620
<!-- Explain the changes in the pull request below: -->
Overrides isOpen on TSSLSocket to preserve old implementation that
doesn't attempt to peek on recv. The update to TSocket in
01d53f483a7531ad4899b522060e8913dca309fb errors for TSSLSocket with
```
ValueError: non-zero flags not allowed in calls to recv() on <class 'ssl.SSLSocket'>
```
<!-- We recommend you review the checklist/tips before submitting a pull request. -->
- [ ] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? (not required for trivial changes)
- [ ] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
- [ ] Did you squash your changes to a single commit? (not required, but preferred)
- [ ] Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
- [ ] If your change does not involve any code, include `[skip ci]` anywhere in the commit message to free up build resources.
<!--
The Contributing Guide at:
https://github.com/apache/thrift/blob/master/CONTRIBUTING.md
has more details and tips for committing properly.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [thrift] MikaelSmith commented on pull request #2620: THRIFT-5595: Avoid peek request with SSLSocket
Posted by GitBox <gi...@apache.org>.
MikaelSmith commented on PR #2620:
URL: https://github.com/apache/thrift/pull/2620#issuecomment-1151363247
I verified this fixes the issue in my scenario that was failing. I didn't dig into how to run these python tests directly, hoping CI would cover it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [thrift] fishy commented on a diff in pull request #2620: THRIFT-5595: Avoid peek request with SSLSocket
Posted by GitBox <gi...@apache.org>.
fishy commented on code in PR #2620:
URL: https://github.com/apache/thrift/pull/2620#discussion_r893004731
##########
lib/py/test/test_socket.py:
##########
@@ -25,6 +25,7 @@ def test_isOpen_checks_for_readability(self):
acc.start()
sock = TSocket(host="localhost", port=acc.port)
+ self.assertFalse(sock.IsOpen())
Review Comment:
this is a typo. it should be `isOpen` instead of `IsOpen`. it's currently causing CI failures: https://app.travis-ci.com/github/apache/thrift/jobs/572946806 & https://app.travis-ci.com/github/apache/thrift/jobs/572946807
##########
lib/py/src/transport/TSSLSocket.py:
##########
@@ -266,6 +266,10 @@ def __init__(self, host='localhost', port=9090, *args, **kwargs):
TSocket.TSocket.__init__(self, host, port, unix_socket,
socket_keepalive=socket_keepalive)
+ # Override TSocket because ssl.SSLSocket does not allow non-zero flags in calls to recv()
+ def isOpen(self):
+ return self.handle is not None
Review Comment:
I would slightly prefer to just catch the exception in `TSocket.isOpen`, but I don't feel strongly either way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [thrift] MikaelSmith commented on pull request #2620: THRIFT-5595: Avoid peek request with SSLSocket
Posted by GitBox <gi...@apache.org>.
MikaelSmith commented on PR #2620:
URL: https://github.com/apache/thrift/pull/2620#issuecomment-1152496457
Thanks for being so helpful with code review and getting this merged!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [thrift] MikaelSmith commented on a diff in pull request #2620: THRIFT-5595: Avoid peek request with SSLSocket
Posted by GitBox <gi...@apache.org>.
MikaelSmith commented on code in PR #2620:
URL: https://github.com/apache/thrift/pull/2620#discussion_r893687599
##########
lib/py/src/transport/TSSLSocket.py:
##########
@@ -266,6 +266,10 @@ def __init__(self, host='localhost', port=9090, *args, **kwargs):
TSocket.TSocket.__init__(self, host, port, unix_socket,
socket_keepalive=socket_keepalive)
+ # Override TSocket because ssl.SSLSocket does not allow non-zero flags in calls to recv()
+ def isOpen(self):
+ return self.handle is not None
Review Comment:
I guess that makes some sense in that we'd largely expect the implementations to be in-sync.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [thrift] fishy commented on pull request #2620: THRIFT-5595: Avoid peek request with SSLSocket
Posted by GitBox <gi...@apache.org>.
fishy commented on PR #2620:
URL: https://github.com/apache/thrift/pull/2620#issuecomment-1152494732
Thanks for the comments and added unit tests!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [thrift] fishy merged pull request #2620: THRIFT-5595: Avoid peek request with SSLSocket
Posted by GitBox <gi...@apache.org>.
fishy merged PR #2620:
URL: https://github.com/apache/thrift/pull/2620
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org