Skip to content

Commit

Permalink
fix pubsub race
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed May 7, 2024
1 parent 1f084e7 commit ec35652
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flow/connectors/pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@ Loop:
}

close(flushLoopDone)
close(publish)
if err := pool.Wait(wgCtx); err != nil {
return nil, err
}
close(publish)
topiccache.Stop(wgCtx)
select {
case <-wgCtx.Done():
Expand Down
2 changes: 1 addition & 1 deletion flow/connectors/pubsub/qrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ Loop:
}
}

close(publish)
if err := pool.Wait(wgCtx); err != nil {
return 0, err
}
close(publish)
topiccache.Stop(wgCtx)
select {
case <-wgCtx.Done():
Expand Down
1 change: 0 additions & 1 deletion flow/e2e/pubsub/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ func (s PubSubSuite) TestInitialLoad() {
})
require.NoError(s.t, err)
_, err = s.Conn().Exec(context.Background(), fmt.Sprintf(`
INSERT INTO %s (id, val) VALUES (1, 'testval')
`, srcTableName))
require.NoError(s.t, err)
Expand Down

0 comments on commit ec35652

Please sign in to comment.