Skip to content

Commit

Permalink
send empty header
Browse files Browse the repository at this point in the history
Signed-off-by: Yashash H L <[email protected]>
  • Loading branch information
yhl25 committed Sep 11, 2024
1 parent c9946b0 commit 568c60d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/sourcer/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ func (fs *Service) ReadFn(stream sourcepb.Source_ReadFnServer) error {
ctx := stream.Context()
errCh := make(chan error, 1)

// Send an empty header so that the client can start sending read requests
// (rust client does not send read requests until it receives a header)
err := stream.SendHeader(map[string][]string{})
if err != nil {
return err
}

var wg sync.WaitGroup

wg.Add(1)
Expand Down Expand Up @@ -133,6 +140,13 @@ func (a *ackRequest) Offset() Offset {
func (fs *Service) AckFn(stream sourcepb.Source_AckFnServer) error {
ctx := stream.Context()

// Send an empty header so that the client can start sending ack requests
// (rust client does not send ack requests until it receives a header)
err := stream.SendHeader(map[string][]string{})
if err != nil {
return err
}

// handle panic
defer func() {
if r := recover(); r != nil {
Expand Down

0 comments on commit 568c60d

Please sign in to comment.