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

await asyncio.ensure_future #860

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

manics
Copy link
Member

@manics manics commented Oct 9, 2024

All other calls to asyncio.ensure_future were either awaited or in one case saved to a member variable, so I've awaited the remaining calls in spawner.py but I'm not sure how to thoroughly test this. I didn't notice any problems when testing this on a small local Z2JH deployment.

$ git grep -n -A2 ensure_future -- kubespawner/spawner.py

kubespawner/spawner.py:2805:            await asyncio.ensure_future(previous_reflector.stop())
kubespawner/spawner.py-2806-
kubespawner/spawner.py-2807-        # wait for first load
--
kubespawner/spawner.py:2867:        futures = [asyncio.ensure_future(task) for task in tasks]
kubespawner/spawner.py-2868-        try:
kubespawner/spawner.py-2869-            await asyncio.gather(*futures)
--
kubespawner/spawner.py:2886:        self._start_future = asyncio.ensure_future(self._start())
kubespawner/spawner.py-2887-        return self._start_future
kubespawner/spawner.py-2888-
--
kubespawner/spawner.py:3089:        start_futures = [asyncio.ensure_future(task) for task in start_tasks]
kubespawner/spawner.py-3090-        try:
kubespawner/spawner.py-3091-            await asyncio.gather(*start_futures)
--
kubespawner/spawner.py:3257:                await asyncio.ensure_future(self._start_watching_pods(replace=True))
kubespawner/spawner.py-3258-            raise
kubespawner/spawner.py-3259-
--
kubespawner/spawner.py:3382:            await asyncio.ensure_future(self._start_watching_pods(replace=True))
kubespawner/spawner.py-3383-            raise
kubespawner/spawner.py-3384-

Related to #858

@manics manics added the bug label Oct 9, 2024
@consideRatio consideRatio merged commit 05e05b4 into jupyterhub:main Oct 11, 2024
8 checks passed
@manics manics deleted the await-ensure-future branch October 11, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants