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

RunRequests with the same run_key emitted in the same sensor evaluation are not de-duplicated #26753

Open
Gw1p opened this issue Dec 28, 2024 · 0 comments
Labels
type: bug Something isn't working

Comments

@Gw1p
Copy link

Gw1p commented Dec 28, 2024

What's the issue?

If a sensor yields multiple RunRequests within a single sensor evaluation, Dagster will launch multiple jobs with the same run_key.

tick

What did you expect to happen?

Based on the response I got here, this doesn't seem to be intentional behavior.

I can see 2 approaches that Dagster can take where either would probably be better than the current state:

  • sensor should de-duplicate the run_keys emitted within a single sensor evaluation. If the run configs differ, it would just take the first one that the sensor yields and uses that to launch a job
  • if sensor detects that there are duplicated run_keys, it raises an error and records Failure in the sensor tick

How to reproduce?

Min example (python 3.11.1; dagster 1.9.5):

import time
from dagster import job, op, Output, sensor, RunRequest

@op
def dummy_op(context):
    context.log.info("Hello")
    yield Output(None)


@job
def dummy_job():
    dummy_op()


@sensor(
    job=dummy_job
)
def dummy_sensor(context):
    now = time.time()
    for i in range(3):
        yield RunRequest(
            run_key=f"run_key_{now}",
        )

On every sensor evalution, dummy_sensor will launch 3 jobs (each with the same run key).

tick

Dagster version

1.9.5

Deployment type

Local

Deployment details

I've experienced this in a dagster helm chart deployment as well as a local one.

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant