Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Closed
wants to merge 8 commits into from

Conversation

dudmz
Copy link
Contributor

@dudmz dudmz commented Dec 29, 2021

@dudmz dudmz requested review from 1st1 and asvetlov as code owners December 29, 2021 17:36
@dudmz dudmz 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

@dudmz
Copy link
Contributor Author

dudmz 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

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

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jan 30, 2022
@asvetlov asvetlov self-assigned this Feb 22, 2022
@arhadthedev
Copy link
Member

For history: this PR is superseded by more conservative gh-98844.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants