`Write` can be called concurrently, for which it calls the `do` function.
As `WriteStatus` can close the `ht.writes` in parallel as well the `Write`
will try to write into the `ht.writes` in the `do` function, this can
lead into a panic. As there is no real usability on closing this channel
we can simply leave it to the garbage collector so we can avoid panic
during an execution.
Signed-off-by: André Martins <aanm90@gmail.com>
golang.org/x/lint recently got a go.mod d0100b6bd8
Let's be sure to minimally use this version, since its dependencies are
now codified.
This CL was generated by deleting the x/lint line in go.mod and running
`go mod tidy`.
Currently, it is not possible to access trailers from within a
stats.Handler. The reason is that both stats.Handler and
ClientStream.Trailer require a lock on the ClientStream.
A workaround would be to start a separate goroutine that will call
ClientStream.Trailer asynchronously, but that requires careful
coordination and we can quite easily make the trailer metadata available
to the stats.Handler directly.
Use case: an interceptor that processes trailer metadata for each
streaming RPC after the stream has finished. Note that a
StreamClientInterceptor returns immediately, before the stream has
finished and before the trailer metadata is available.
Keep the drop index from the previous picker when regenerating picker due to
subchannel state change. Only reset the drop index when picker is regenerated
because of a serverlist update.
fixes#2623
This removes RequireHandshakeHybrid support and changes the default behavior
to RequireHandshakeOn. Dial calls will now block and wait for a successful
handshake before proceeding. Users relying on the old hybrid behavior (cmux
users) should consult https://github.com/soheilhy/cmux/issues/64.
Also, several tests have been updated to take this into consideration by
sending settings frames.
* ADDED package level comments for: benchmark/, examples/helloworld/
* UPDATED code to run gofmt
* FIXED linter errors
* FIXED spelling error
* FIXED documentation based on feedback
* FIXED comment to add pointer to another file
* ADDED reference to start server
* ADDED fix to include command to start server
* Fixes established streams leak in the loopy writer.
RSTStreamFrames used to be ignored by the server transport, if a trailer had already been put into the transport's control buffer. If loopy writer couldn't write anything into a stream because of an error on the client side, then this trailer would never be sent. At that point, server would receive an RSTStreamFrame from client. But this RSTStreamFrame would be ignored because a trailer was already put into the control buffer. This would keep the stream open and in memory on the server side.
With this change, a cleanupStream item is put into the transport's control buffer, whenever an RSTStreamFrame is received by the server, even after a trailer has been put into the buffer.
* When client sends a header to initiate a stream just after sending an RST_STREAM, server gets these frames in the correct order.
When server receives the RST_STREAM, it marks the stream as done and defers the deletion of the stream to the loopy writer by putting a cleanupStream item into control buffer.
Then the server receives the header to initiate a stream. It acts on the header immediately and attempts to create the stream. But because the old stream is not deleted, it hits the number of streams limit and fails.
This commit solves this problem by letting server handle the deletion immediately after receiving the RST_STREAM.
* Refactors deleteStream method.
* Moves consts declarations into test function's body.
internal: resetTransport connect deadline is across addresses
Currently, the connect deadline is recalculated per-address. This PR amends
that behavior such that all addresses for a single connection attempt share
the same deadline.
Fixes#2462
balancerGroup takes a list of balancers, and make then into one balancer.
Updates from ClientConn are forwarded to sub-balancers
- service config update
- Not implemented currently
- address update
- subConn state change
- find the corresponding balancer and forward
Actions from sub-balances are forwarded to parent ClientConn
- new/remove SubConn
- picker update and health states change
- sub-pickers are grouped into a group-picker
- aggregated connectivity state is the overall state of all pickers.
- resolveNow