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(dataflow): make each replica use unique subscription names #6021

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

lc525
Copy link
Member

@lc525 lc525 commented Nov 1, 2024

Following #6020, it was no longer possible to have multiple replicas of dataflow-engine subscribing simultaneously to the scheduler, because all were connecting with the same subscriber name, and a lock was added per name, first waiting the disconnection of the old subscriber before allowing a new one to progress.

We update the dataflow-engine code so that each replica connects with its own hostname as the subscriber name. If the hostname can not be determined, we subscribe with the name seldon-dataflow-engine- followed by a hex string of 50 random characters.

The subscriber name can also be explicitly controlled by passing the --dataflow-replica-id argument or the DATAFLOW_REPLICA_ID environment variable, wich will take precedence, in that order, to setting the value as the hostname.

Special notes for your reviewer:

  • tested in kind, hostname gets correctly picked up:
    • On the dataflow end:
      dataflow-id
    • On the scheduler end:
      scheduler-dataflow-id

@lc525 lc525 requested a review from sakoush as a code owner November 1, 2024 12:57
@lc525 lc525 added the v2 label Nov 1, 2024
Copy link
Member

@sakoush sakoush left a comment

Choose a reason for hiding this comment

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

lgtm

Following SeldonIO#6020, it was no longer possible to have multiple replicas of
dataflow-engine subscribing simultaneously to the scheduler, because
all were connecting with the same subscriber name, and a lock was added
per name, first waiting the disconnection of the old subscriber before
allowing a new one to progress.

We update the dataflow-engine code so that each replica connects with
its own hostname as the subscriber name. If the hostname can not
be determined, we subscribe with the name `seldon-dataflow-engine-` followed
by a hex string of 50 random characters.

The subscriber name can also be explicitly controlled by passing the
`--dataflow-replica-id` argument or the `DATAFLOW_REPLICA_ID` environment
variable, wich will take precedence, in that order, to setting the value
as the hostname.
@lc525 lc525 force-pushed the quickfix/dataflow-subscriber-name branch from 8e7a825 to f53945c Compare November 1, 2024 14:52
@lc525 lc525 merged commit 2c79e77 into SeldonIO:v2 Nov 1, 2024
3 checks passed
@lc525 lc525 deleted the quickfix/dataflow-subscriber-name branch November 1, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants