-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make _determine_next_host
an async function
#102
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Hi @divyansshhh - thank you for using Gateway Provisioners and opening this issue. I think this makes a lot of sense (and should have probably been async from the start). Because async def determine_next_host(self, env_dict: dict) -> str: Do you see any issues with that? Would you be willing to create such a pull request? Thanks, |
I don't see any issues with this, I can raise the PR for this. |
It just occurred to me that we could preserve backward compatibility by injecting an async method without the underscore that then calls the current sync method. Then await the call to the new method. Folks that want custom behaviors could then override the new method. (This may have been what you were thinking anyway.) |
I agree with the suggestion and I had something similar in mind. I'm trying to debug something which may or may not be related to this. Let me do that and then raise the PR. |
Apologies for the delay here, raised - #122 |
Problem
We are creating a custom kernel provisioner and we have an API for finding a host based on certain parameters but this API takes upto 20s to send the host. This 20s wait blocks the server and makes lab unusable during those 20s. We tried making the
_determine_next_host
function async ourselves by running the host fetching API in aasyncio
'srun_in_executor
and awaiting the_determine_next_host
call in thelaunch_kernel
function.A simple reproducer for this is adding a
asyncio.sleep(10)
in theDistributedProvisioner._determine_next_host
function. The result will be that the kernel never reaches an alive state.Proposed Solution
We would like a way to asynchronously determine the next host.
Additional context
I'm using
gateway_provisioners
v0.2.0The text was updated successfully, but these errors were encountered: