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

azure: use selector event loop for windows #5983

Merged
merged 1 commit into from
May 10, 2021

Conversation

isidentical
Copy link
Contributor

Resolves #5982

Copy link
Member

@efiop efiop left a comment

Choose a reason for hiding this comment

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

For the record: discussed with @isidentical that we'll try to submit it to adlfs, as it is closer to to aiohttp than we are.

@isidentical
Copy link
Contributor Author

roshan on discord tested it out and confirmed that it works with proxies on windows: https://discord.com/channels/485586884165107732/485596304961962003/840211663386050611

@efiop
Copy link
Member

efiop commented May 7, 2021

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented May 7, 2021

Command rebase: success

Branch has been successfully rebased

@efiop efiop enabled auto-merge (squash) May 7, 2021 18:37
@efiop
Copy link
Member

efiop commented May 7, 2021

@isidentical Looks like windows is failing:

2021-05-07T18:49:23.2800440Z ____________________________ test_temp_event_loop _____________________________
2021-05-07T18:49:23.2801531Z [gw3] win32 -- Python 3.8.9 C:\hostedtoolcache\windows\Python\3.8.9\x64\python.exe
2021-05-07T18:49:23.2802427Z 
2021-05-07T18:49:23.2802997Z     def test_temp_event_loop():
2021-05-07T18:49:23.2803382Z         def procedure():
2021-05-07T18:49:23.2803806Z             loop = asyncio.get_event_loop()
2021-05-07T18:49:23.2804326Z             loop.run_until_complete(asyncio.sleep(0))
2021-05-07T18:49:23.2804767Z             return "yeey"
2021-05-07T18:49:23.2805077Z     
2021-05-07T18:49:23.2805432Z         def wrapped_procedure():
2021-05-07T18:49:23.2806161Z             with _temp_event_loop():
2021-05-07T18:49:23.2806544Z                 return procedure()
2021-05-07T18:49:23.2807014Z     
2021-05-07T18:49:23.2807357Z             # it should clean the loop after
2021-05-07T18:49:23.2807771Z             # exitting the context.
2021-05-07T18:49:23.2808220Z             with pytest.raises(RuntimeError):
2021-05-07T18:49:23.2808690Z                 asyncio.get_event_loop()
2021-05-07T18:49:23.2809024Z     
2021-05-07T18:49:23.2809471Z         with ThreadPoolExecutor(max_workers=1) as executor:
2021-05-07T18:49:23.2810329Z             future = executor.submit(procedure)
2021-05-07T18:49:23.2810711Z     
2021-05-07T18:49:23.2811075Z             with pytest.raises(RuntimeError):
2021-05-07T18:49:23.2811516Z                 future.result()
2021-05-07T18:49:23.2811812Z     
2021-05-07T18:49:23.2812402Z             future = executor.submit(wrapped_procedure)
2021-05-07T18:49:23.2813182Z >           assert future.result() == "yeey"
2021-05-07T18:49:23.2813474Z 
2021-05-07T18:49:23.2813794Z tests\unit\fs\test_azure.py:69: 
2021-05-07T18:49:23.2814183Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2021-05-07T18:49:23.2814786Z C:\hostedtoolcache\windows\Python\3.8.9\x64\lib\concurrent\futures\_base.py:444: in result
2021-05-07T18:49:23.2815386Z     return self.__get_result()
2021-05-07T18:49:23.2816343Z C:\hostedtoolcache\windows\Python\3.8.9\x64\lib\concurrent\futures\_base.py:389: in __get_result
2021-05-07T18:49:23.2816939Z     raise self._exception
2021-05-07T18:49:23.2817499Z C:\hostedtoolcache\windows\Python\3.8.9\x64\lib\concurrent\futures\thread.py:57: in run
2021-05-07T18:49:23.2818138Z     result = self.fn(*self.args, **self.kwargs)
2021-05-07T18:49:23.2818660Z tests\unit\fs\test_azure.py:55: in wrapped_procedure
2021-05-07T18:49:23.2819095Z     return procedure()
2021-05-07T18:49:23.2819514Z tests\unit\fs\test_azure.py:49: in procedure
2021-05-07T18:49:23.2820134Z     loop = asyncio.get_event_loop()
2021-05-07T18:49:23.2820551Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2021-05-07T18:49:23.2820769Z 
2021-05-07T18:49:23.2821490Z self = <asyncio.windows_events.WindowsSelectorEventLoopPolicy object at 0x000001A385AB2250>
2021-05-07T18:49:23.2822314Z 
2021-05-07T18:49:23.2822869Z     def get_event_loop(self):
2021-05-07T18:49:23.2823330Z         """Get the event loop for the current context.
2021-05-07T18:49:23.2823700Z     
2021-05-07T18:49:23.2824152Z         Returns an instance of EventLoop or raises an exception.
2021-05-07T18:49:23.2824786Z         """
2021-05-07T18:49:23.2825128Z         if (self._local._loop is None and
2021-05-07T18:49:23.2825575Z                 not self._local._set_called and
2021-05-07T18:49:23.2826498Z                 isinstance(threading.current_thread(), threading._MainThread)):
2021-05-07T18:49:23.2827111Z             self.set_event_loop(self.new_event_loop())
2021-05-07T18:49:23.2827490Z     
2021-05-07T18:49:23.2827984Z         if self._local._loop is None:
2021-05-07T18:49:23.2828476Z >           raise RuntimeError('There is no current event loop in thread %r.'
2021-05-07T18:49:23.2829058Z                                % threading.current_thread().name)
2021-05-07T18:49:23.2829753Z E           RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-275_0'.
2021-05-07T18:49:23.2830290Z 
2021-05-07T18:49:23.2830810Z C:\hostedtoolcache\windows\Python\3.8.9\x64\lib\asyncio\events.py:639: RuntimeError

@efiop efiop disabled auto-merge May 7, 2021 18:56
@isidentical
Copy link
Contributor Author

Looks like windows is failing:

I will check later 👀

@efiop efiop merged commit fc4e31b into iterative:master May 10, 2021
@efiop efiop added the bugfix fixes bug label May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix fixes bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azure: doesn't work with proxies on windows
2 participants