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

[flytekit/async] Context manager & general thread/coroutine safety #6073

Open
2 tasks done
wild-endeavor opened this issue Dec 2, 2024 · 0 comments
Open
2 tasks done
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working flytekit FlyteKit Python related issue

Comments

@wild-endeavor
Copy link
Contributor

wild-endeavor commented Dec 2, 2024

Overview

The flytekit sdk has been traditionally developed without much regard for thread-safety and simultaneous access of objects. With the introduction of async support and the ability to run multiple tasks concurrently if not in parallel, we should revisit these assumptions, fix and test bugs and limitations.

This is also likely going to be a problem with the new async workflows effort that will be done.

The context manager is a known issue but we should find others as well.

Context Manager

The context manager probably is the biggest offender here. This is a global list of context states and is appended to every time a new task is run, among other operations. This breaks in the new eager model for instance. If you have the following series of tasks.

@task
def t1():
    print("normal task")

@eager
def eg_1():
    some_other_task()

@eager
def eg_p():
    t1()
    eg_1()

because each of eg_p, t1, and eg_1 will try to set context by appending something to the list, the view of what is FlyteContextManager.current_context() will not make sense.

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@wild-endeavor wild-endeavor added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Dec 2, 2024
@wild-endeavor wild-endeavor changed the title [flytekit/async] Context manager does not work [flytekit/async] Context manager & general thread/coroutine safety Dec 2, 2024
@wild-endeavor wild-endeavor added backlogged For internal use. Reserved for contributor team workflow. flytekit FlyteKit Python related issue labels Dec 3, 2024
@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working flytekit FlyteKit Python related issue
Projects
Status: Backlog
Development

No branches or pull requests

2 participants