bpo-32622: Native sendfile on windows#5565
Conversation
|
@1st1 please review |
|
|
||
| def _force_close(self, exc): | ||
| if self._empty_waiter is not None: | ||
| self._empty_waiter.set_exception(exc) |
There was a problem hiding this comment.
exc can be None, for instance when transport.abort() is called.
| self.run_loop( | ||
| self.loop.sendfile(cli_proto.transport, self.file, | ||
| fallback=False)) | ||
| fallback=False)) |
There was a problem hiding this comment.
This looks like an unrelated change that will cause a linting error, no?
|
|
||
| @unittest.skipIf(sys.platform != 'win32', | ||
| 'Proactor is supported on Windows only') | ||
| class ProactorEventLoopUnixSockSendfileTests(test_utils.TestCase): |
There was a problem hiding this comment.
Are these entirely new tests? I thought we already had many functional tests for *nix. Can we just reuse those?
There was a problem hiding this comment.
It was my try but I figured out that tests from test_unix_events_py not completely functional only, they use selector specific mocks for testing edge cases.
Proactor based implementation is different.
There was a problem hiding this comment.
Is it possible to have a common base class with functional tests and subclasses for selector- and proactor-loops with custom setUp() methods for mocking?
Having one source for sendfile tests would be super great and useful.
There was a problem hiding this comment.
I'll try to master something
There was a problem hiding this comment.
I'm on conference now, will have a time to work on tests at the beginning of the next week.
|
When you're done making the requested changes, leave the comment: |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @1st1: please review the changes made to this pull request. |
|
Andrew, can we move all sendfile-related tests to a new |
1st1
left a comment
There was a problem hiding this comment.
As discussed, please move the tests into a separate file in a follow up pr.
|
We have an agreement that the test movement can be done in an separate PR. |
|
@asvetlov: Please replace |
|
Thanks @asvetlov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
* Support sendfile on Windows Proactor event loop naively. (cherry picked from commit a19fb3c) Co-authored-by: Andrew Svetlov <[email protected]>
|
GH-5890 is a backport of this pull request to the 3.7 branch. |
* Support sendfile on Windows Proactor event loop naively. (cherry picked from commit a19fb3c) Co-authored-by: Andrew Svetlov <[email protected]>
Implement native sendfile on proactor event loop
https://bugs.python.org/issue32622