Comments (8)
This should not happen if the interval between step 2 and 4 is long enough.
Can you provide the timing of the above steps (especially, step 2, 3, 4, 5).
I am on vacation this week and will try to look into it sometime next week
if you can provide enough info to facilitate my debugging.
On Mon, Apr 6, 2015 at 7:22 PM, prazzt [email protected] wrote:
A simple ping pong rpc with increasing counter. Client send ping every n
seconds interval, specifying timeout on context.What happened:
- Client-server ping pong smoothly.
- Turn off network connection.
- Client failed "context deadline exceeded". Client's main exited.
- Turn on network connection.
- After sometime, server received ghost ping message with updated counter.
Expected:
Server shouldn't receive message, since client process already exit.Seems like low level retransmission problem. I'm not familiar with HTTP2
protocol, but if we can control it, I expect client to not retransmit once
the context is canceled.—
Reply to this email directly or view it on GitHub
#150.
from grpc-go.
Ahh okay, just enjoy your holiday man .. :)
This should not happen if the interval between step 2 and 4 is long enough.
How long is long enough ? Where is this number defined ?
I only tested for short interval between 2-4 (around 2 minutes), will try to test for longer duration.
from grpc-go.
I added a gist to help debugging. In my test, after turning of network about 2.5 minutes, message won't be retransmitted.
Is this expected ? how can I control the period ?
from grpc-go.
I had difficulty to reproduce it. Are you sure the client's main existed before the network connection is on?
from grpc-go.
Yes, I'm sure. I just reinstalled all dependencies (grpc, protobuf) just in case.
- go version go1.4 linux/386
- two machines, internal network
Steps:
- Run client.go on machine1, server.go on machine2
- Turn off network connection in machine1, it should exit automatically. Output
2015/04/16 06:04:52 Received 0 from server
2015/04/16 06:04:55 Received 1 from server
2015/04/16 06:04:58 Received 2 from server
2015/04/16 06:05:01 Received 3 from server
2015/04/16 06:05:09 stream error rpc error: code = 4 desc = "context deadline exceeded"
2015/04/16 06:05:09 client shutting down
- Machine2 stays on:
2015/04/16 06:04:52 Received 0 from client
2015/04/16 06:04:55 Received 1 from client
2015/04/16 06:04:58 Received 2 from client
2015/04/16 06:05:01 Received 3 from client
- Turns on network on machine1
- After some period, the fourth message appear on machine2
2015/04/16 06:05:58 Received 4 from client
2015/04/16 06:05:58 grpc: Server.processUnaryRPC failed to write status: connection error: desc = "transport: use of closed network connection"
from grpc-go.
If it helps, netstat says FIN_WAIT1 on machine1 while connection's off.
from grpc-go.
According to this
All segments preceding and including FIN
will be retransmitted until acknowledged. When the other TCP has
both acknowledged the FIN and sent a FIN of its own, the first TCP
can ACK this FIN.
Can you try and turn the network only after the socket on the client side no longer exists? I believe the timeout on a standard Linux system is 2 minutes.
from grpc-go.
On Thu, Apr 16, 2015 at 6:42 AM, prazzt [email protected] wrote:
If it helps, netstat says FIN_WAIT1 on machine1 while connection's off.
okay, it seems you did not unplug the network cable. Instead you disabled
network connection causing machine1 sent FIN. In this case, the kernel of
machine1 will keep retrying with exponential backoff tcp_orphan_retries
(default 8) times. If you enable network during retrying, the server could
receive 4th message. If you use netstat to monitor the state of tcp socket
on machine1 to make sure it disappears, the server should not receive 4th
msg any more.—
Reply to this email directly or view it on GitHub
#150 (comment).
from grpc-go.
Related Issues (20)
- Minor 'invalid code' error output suggestion
- advancedtls package does not set VerifiedChains in TLSInfo.State HOT 5
- question: Bidirectional Streaming get error: rpc error: code = `Canceled` desc = `context canceled` HOT 6
- Delayed dns resolve after upgrade to v1.60.0 HOT 5
- channelz: SubChannel do not report their Target properly since 1.63 HOT 1
- xds: support LRS for all cluster types HOT 4
- Updating credentials of a running server HOT 7
- clusterimpl: update picker synchronously upon receipt of configuration update HOT 1
- cds: update picker synchronously upon receipt of configuration update
- rls: update picker synchronously upon receipt of configuration update
- Improve grpc-go/Documentation to clearly specify usage of `grpc.SetTrailer` function for adding metadata to send to client
- New ServerOption to set cancel insensitive "values" context. HOT 1
- Return the actual error from unary RPCs when `SendMsg()` returns `io.EOF` HOT 14
- protoc-gen-go-grpc: copy service comment to interfaces HOT 2
- Deprecate Dial and DialContext through a mechanism that doesn't trigger linters HOT 1
- Flaky test: 6/100K: Test/LRSClient HOT 2
- Docs: Document how to migrate from `Dial, DialContext, WithBlock, WithReturnConnectionError, FailOnNonTempDialError` to `NewClient` HOT 3
- Stop supporting 3 releases of Go HOT 2
- <invalid gRPC request method "PRI">, when happend grpc and http use sample port HOT 2
- It seems that there is a memory leak issue in the HandleStreams function. HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-go.