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

fix(studio): wait for studio metrics publish to complete on end #827

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

shcheklein
Copy link
Member

W/o this fix in the example-get-started-experiments we are not getting images published to Studio (it doesn't have time to complete, evaluate exits faster).


Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@shcheklein shcheklein self-assigned this Jun 8, 2024
@shcheklein shcheklein added A: end Area: `Live.end` A: studio Area: Studio integration bug Did we break something? labels Jun 8, 2024
@shcheklein shcheklein requested a review from skshetry June 8, 2024 23:42
@dberenbaum
Copy link
Collaborator

Looking at the discussion from when we added threads, I think this was intentional and is why the thread has daemon=True. Some questions:

  1. Does dropping daemon=True accomplish the same thing?
  2. What happens if any call to Studio hangs? I think that was why I added daemon=True.
  3. Could we make a final data post to Studio in the main thread? That would ensure the final data is posted without needing every post to return.

@shcheklein
Copy link
Member Author

Looking at the discussion from when we added threads, I think this was intentional and is why the thread has daemon=True. Some questions:

Right, but at the end of the process if becomes unpredictable / we are losing data ... not sure this is expected tbh ...

Does dropping daemon=True accomplish the same thing?

We would need probably then a way to signal that thread to complete?

Does dropping daemon=True accomplish the same thing?

In this case it be waiting only at the end ... we can probably put some timeout? But as far as I understand we already do have some timeouts on post to studio call. So, it should not be infinite ...

That would ensure the final data is posted without needing every post to return.

Could you clarify please? Not sure how this idea is easier / can help tbh ...

Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

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

If we already have some timeouts for Studio posts, I'm fine to merge this. I assume it should be no worse than what we had before threads.

@shcheklein
Copy link
Member Author

I assume that timeout is specified here:

response = requests.post(
            url,
            json=body,
            headers={
                "Content-type": "application/json",
                "Authorization": f"token {token}",
            },
            timeout=(30, 5),
        )

@shcheklein shcheklein merged commit b987e66 into main Jun 10, 2024
14 checks passed
@shcheklein shcheklein deleted the fix/wait-for-publish-to-complete-on-end branch June 10, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: end Area: `Live.end` A: studio Area: Studio integration bug Did we break something?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants