grpc / grpc/grpc-web

net::ERR_CONNECTION_RESET 200 (OK)

Open
#1,341 1 comment 1 reaction 0 assignees View on GitHub
Help welcome!
Dominant language
JavaScript
Stars
9.3k
Forks
802
Avg merge
1d 7h
Merged PRs (30d)
5

Description

I'm now in a situation like this:
Client: grpc-web, typescript
Server: akka-stream, akka-grpc, akka-http, scala

premise:
The client sends a request to the server through ClientReadableStream, and the server returns a stream.

need:
I want to close the server now, and eventually kill the server process, so I executed the System.exit(1) method.

The specific execution steps are as follows
First: close the active stream (KillSwitches.shared("service-switch").shutdown())
Second: close akka-http (ServerBinding.terminate)
Third: Close the ActorSystem (ActorSystem.terminate())
Fourth: Close the process (System.exit)

But in the browser I occasionally get the following error
http://xxxxxx/xxxxx/getStream net::ERR_CONNECTION_RESET 200 (OK)

Client, this is how I listen to the stream

`


const stream_result = client.getFSStationResultStream(request,{token: 'XYZ'})
stream_result.on('end', () => {
console.log('stream_result end')
stream_result.removeListener('end')
})
`

However, I found that stream_result.on('end',...) fires twice every time the process is killed. In most cases, two times are normal, and occasionally there will be an error, Please see the information below.

In most cases, the browser's console print information is like this
stream_result end
stream_result end

Occasionally this happens:
stream_result end
index.js:42 POST http://10.20.243.23:50052/proto.web.FusiaWebService/getFSStationResultStream net::ERR_CONNECTION_RESET 200 (OK)

Can anyone help to analyze the cause of the problem?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.