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 blocking image observer #1

Closed
wants to merge 1 commit into from
Closed

Conversation

chiting
Copy link
Owner

@chiting chiting commented Dec 1, 2024

I'm not very good with python but I figured this should fix some issues happening when running locally with Podman.

Which issue(s) does this change fix?

aws#7298

Why is this change necessary?

Calling the events function from the main thread will block until it receives data as docker-py uses urllib3.openurl under the hood which is blocking (read).

How does it address the issue?

We don't want to block the main thread, so moving the self.events assignment in a thread seems to be the solution.

What side effects does this change have?

I can't see any side effect this would introduce.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Calling the events function from the main thread will block until it receives data as docker-py uses urllib3.openurl under the hood which is blocking (read). Moving the self.events assignment in a thread.
@chiting chiting closed this Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant