Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-46194: Make selector inherit asyncio.DatagramTransport #30291

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

carlosdamazio
Copy link
Contributor

@carlosdamazio carlosdamazio commented Dec 29, 2021

@carlosdamazio carlosdamazio changed the title bpo-46194: Make Selector inherit asyncio.DatagramTransport bpo-46194: Make selector inherit asyncio.DatagramTransport Dec 29, 2021
Copy link
Contributor

@asvetlov asvetlov left a comment

A good step forward. Now _SelectorDatagramTransport supports both DatagramTransport and streamed Transport.
The last is wrong.
Also, DatagramTransport has no get_write_buffer_size() method, it should be moved from _SelectorTransport to _SelectorSocketTransport.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Dec 30, 2021

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@carlosdamazio
Copy link
Contributor Author

@carlosdamazio carlosdamazio commented Dec 30, 2021

Hi @asvetlov, I have made the requested changes; please review again. I removed the whole Transport inheritance and made the appropriate additions to the class. However, there are still some issues while executing the tests. They're related on how are we passing exceptions to the event loop.

======================================================================
FAIL: test_sendto_ready_closing (test.test_asyncio.test_selector_events.SelectorDatagramTransportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/damnazio/repos/contributing/cpython/Lib/test/test_asyncio/test_selector_events.py", line 1301, in test_sendto_ready_closing
    self.protocol.connection_lost.assert_called_with(None)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damnazio/repos/contributing/cpython/Lib/unittest/mock.py", line 911, in assert_called_with
    raise AssertionError(error_message)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: expected call not found.
Expected: mock(None)
Actual: not called.

======================================================================
FAIL: test_fatal_error_custom_exception (test.test_asyncio.test_selector_events.SelectorTransportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/damnazio/repos/contributing/cpython/Lib/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damnazio/repos/contributing/cpython/Lib/unittest/mock.py", line 1342, in decoration_helper
    yield (args, keywargs)
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damnazio/repos/contributing/cpython/Lib/unittest/mock.py", line 1356, in patched
    return func(*newargs, **newkeywargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damnazio/repos/contributing/cpython/Lib/test/test_asyncio/test_selector_events.py", line 467, in test_fatal_error_custom_exception
    m_exc.assert_called_with(
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damnazio/repos/contributing/cpython/Lib/unittest/mock.py", line 920, in assert_called_with
    raise AssertionError(_error_message()) from cause
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: expected call not found.
Expected: error('Fatal error on transport\nprotocol:.*\ntransport:.*', exc_info=(<class 'test.test_asyncio.test_selector_events.SelectorTransportTests.test_fatal_error_custom_exception.<locals>.MyError'>, <ANY>, <ANY>))
Actual: error('Exception in default exception handler', exc_info=True)

----------------------------------------------------------------------

Can you show me some pointers to this issue? Thank you!

@github-actions
Copy link

@github-actions github-actions bot commented Jan 30, 2022

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 30, 2022
@asvetlov asvetlov self-assigned this Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes CLA signed stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants