Skip to content

[BUG] Unexpected runtimes with resource requests and overridden resource requests #6390

@Mathis-Z

Description

@Mathis-Z

Describe the bug

I am running the following script on Kubernetes and the runtimes are unexpected:

from flytekit import workflow, Resources, task

from tasks.simple_directory_importer import import_directory_from_url

@task(requests=Resources(cpu="1"))
def fast_task():
    pass

@task
def slow_task():
    pass

@workflow()
def wf() -> None:
    fast_task() # finishes in ~4 seconds
    slow_task().with_overrides(requests=Resources(cpu="1")) # finishes in ~60 seconds

    slow_task().with_overrides(limits=Resources(cpu="1")) # finishes in ~4 seconds

This is related to #6377

Expected behavior

I expect all three tasks to run in the same amount of time.

Additional context to reproduce

No response

Screenshots

No response

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

  • Yes

Have you read the Code of Conduct?

  • Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstalewaiting for reporterUsed for when we need input from the bug reporter

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions