Prevent panic from closing recv channel, which may be written to after
close. Use a separate channel to signal recv has closed and check that
channel on read and write.
Signed-off-by: Derek McGowan <derek@mcg.dev>
Unwrap io.EOF and io.ErrUnexpectedEOF in the case of read message error
which would lead to leaked server connections.
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
Update GitHub Actions runner OS from Ubuntu 18.04 to Ubuntu 22.04.
Update actions/setup-go from v2 to v3. Update Go compiler from Go 1.17
to Go 1.20. Update golangci-lint from v1.45.0 to v1.51.2 for Go 1.20
support. Remove deprecated `-i` flag from make coverage target.
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
Simplify close idle connections logic in server shutdown to be more
intuitive. Modify add connection logic to check if server has been
shutdown before adding any new connections. Modify test to make all
calls before server shutdown.
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
Make `TestServerRequestTimeout` deadline assertion log print expected
and actual values in the same format for more clear troubleshooting.
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
The ttrpc server somtimes receives `ECONNRESET` rather than `EOF` when
the client is exited. Such as reading from a closed connection. Handle
it properly to avoid goroutine and connection leak.
Change-Id: If32711cfc1347dd2da27ca846dd13c3f5af351bb
Signed-off-by: liyuxuan.darfux <liyuxuan.darfux@bytedance.com>
In a connection, streams are added only, but not deleted.
When replying to the last data, delete the stream from map.
And delete operations require concurrency.
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Otherwise, this generator creates a Go file with some import statements,
that causes "imported and not used" error.
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
Add flag to indicate that a data message used with a close flag
is not sending any data. This clears up any ambiguity over whether the
final data message is transmitting a zero length data message or no
data at all.
Signed-off-by: Derek McGowan <derek@mcg.dev>
Implementation of the 1.2 protocol with support for streaming. Provides
the client and server interfaces for implementing services with
streaming.
Unary behavior is mostly unchanged and avoids extra stream tracking just
for unary calls. Streaming calls are tracked to route data to the
appropriate stream as it is received.
Stricter stream ID handling, disallowing unexpected re-use of stream
IDs.
Signed-off-by: Derek McGowan <derek@mcg.dev>