Closed gaoxingliang closed 4 months ago
Where do you log? In the service or an interceptor?
Where do you log? In the service or an interceptor?
@ST-DDT The log is added in normal service log. in order to investigate why it sends twice, I added the log interceptor recently into production environment. and try to check .
I found the root cause is still in my code. I have a structure like: -- main task call the stub. --- generate a batch of sub tasks with different api calls (which will execute in a seperate thread pool.) one of them will call the stub again.
Sorry for misleading.
The context
there should only be at most once grpc request
The bug I found the grpc server we received the same requests twice in less than 40ms. and both finished successfully. I have a grpc client C which send request to a grpc server S: but when I checked the logs and found the server received duplicated request. The versions see below section. Stacktrace and logs
the client logs:
this will trigger a code, the main stub is a grpc call:
the retry template is configured as: note the backoff is 2000 (2 seconds)
while at the server side, I received twice and the interval is less than 40ms: (the input args, user id card and username are same)
note the time in two machines are not same. and you can see: the first call is 12-31 11:47:30.444.+0800. while the second is : 12-31 11:47:30.486.+0800 (40ms and is less than the retry backoff)
client conf:
server conf:
no additional java code configuration.
Steps to Reproduce I tried to reproduce locally, but failed.
The application's environment
Which versions do you use?
Additional context