Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net::ERR_CONNECTION_RESET 200 (OK) #1341

Open
DAIMENGEN4 opened this issue Jun 8, 2023 · 1 comment
Open

net::ERR_CONNECTION_RESET 200 (OK) #1341

DAIMENGEN4 opened this issue Jun 8, 2023 · 1 comment

Comments

@DAIMENGEN4
Copy link

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?

@DAIMENGEN4
Copy link
Author

Sorry, the problem description is wrong. The end event doesn't fire twice, it fires once, sometimes it succeeds, sometimes it fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants