fix various race conditions when writing packets to closed clients or server sessions (#684)

This commit is contained in:
Alessandro Ros
2025-01-19 12:07:59 +01:00
committed by GitHub
parent b2cfa93d13
commit ca6286321d
12 changed files with 438 additions and 219 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
)
func TestAsyncProcessorStopAfterError(t *testing.T) {
func TestAsyncProcessorCloseAfterError(t *testing.T) {
p := &asyncProcessor{bufferSize: 8}
p.initialize()
@@ -17,8 +17,8 @@ func TestAsyncProcessorStopAfterError(t *testing.T) {
p.start()
<-p.stopped
<-p.chStopped
require.EqualError(t, p.stopError, "ok")
p.stop()
p.close()
}