Skip to content

fix: Condition ClientID updates and watcher notifications on command success #1680

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions internal/server/ironhawk/iothread.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ func (t *IOThread) StartSync(ctx context.Context, shardManager *shardmanager.Sha
// Also, CLientID is duplicated in command and io-thread.
// Also, we shouldn't allow execution/registration incase of invalid commands
// like for B.WATCH cmd since it'll err out we shall return and not create subscription
t.ClientID = _c.ClientID
if err == nil {
t.ClientID = _c.ClientID
}

if c.Cmd == "HANDSHAKE" {
if c.Cmd == "HANDSHAKE" && err == nil {
t.ClientID = _c.C.Args[0]
t.Mode = _c.C.Args[1]
}
Expand All @@ -79,7 +81,9 @@ func (t *IOThread) StartSync(ctx context.Context, shardManager *shardmanager.Sha

// TODO: Streamline this because we need ordering of updates
// that are being sent to watchers.
watchManager.NotifyWatchers(_c, shardManager, t)
if err == nil {
watchManager.NotifyWatchers(_c, shardManager, t)
}
}
}

Expand Down