Skip to content

Commit 33a04f6

Browse files
authored
fix: Check if start is nil before consuming in echo provisioner (coder#2686)
This caused a race seen here: https://github.com/coder/coder/runs/7074123929?check_suite_focus=true#step:10:217
1 parent 8293894 commit 33a04f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

provisioner/echo/serve.go

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ func (e *echo) Provision(stream proto.DRPCProvisioner_ProvisionStream) error {
8282
return err
8383
}
8484
request := msg.GetStart()
85+
if request == nil {
86+
// A cancel could occur here!
87+
return nil
88+
}
8589
for index := 0; ; index++ {
8690
extension := ".protobuf"
8791
if request.DryRun {

0 commit comments

Comments
 (0)