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
[Web] Support Grpc configuration in Web Client SDK #8048
Comments
Hi @delaneyb , If I understand correctly, there are two issues you described in the ticket:
Please let me know if I miss summarize anything. |
Hi @cherylEnkidu, That is correct. In regards to 2., note the Also, it is important to distinguish between scenarios where the socket is closed and the application is notified of this, and the connection just silently going dead due to some intervening infrastructure or software:
|
Hi @delaneyb , I consult our grpc team, their suggestions as the following: Sometimes the client doesn't see connections drop, for whatever reason. The gRPC keepalive functionality can help here. When configured, the client will wait an amount of time equal to the grpc.keepalive_time_ms parameter, then send a ping. If it doesn't get a response within the grpc.keepalive_timeout_ms, it will consider the connection closed. If grpc.keepalive_permit_without_calls is set to 1, it will do this even if there are no streams active. |
Hi @cherylEnkidu, I have found related issues googleapis/nodejs-firestore#791 and googleapis/nodejs-firestore#1057 in nodejs-firestore, however firebase/firebase-js-sdk does not seem to expose a Using @google-cloud/firestore is not viable because it requires IAM/admin service accounts, which we do not want on devices running the Node.js program. |
Hi @delaneyb , Unfortunately Web Client SDK doesn't have a way to config grpc settings via Firestore yet. I will make this ticket as a feature request and track the ticket(b/329681553). Thank you for your reporting again! |
Operating System
Debian GNU/Linux 11 (bullseye) Linux 6.1.21-v8+
Browser Version
Node 16.20.0
Firebase SDK Version
10.8.1
Firebase SDK Product:
Auth, Firestore
Describe your project's tooling
esbuild ^0.19.5
Describe the problem
The Firebase JavaScript SDK when running in a Node.js environment (may also affect others) takes in excess of 15 minutes to detect a silently broken network connection (e.g. NAT entry erased or traffic blocking being applied) preventing Firestore listeners on the device from receiving updates and writes from reaching the server.
history.txt
grpc-logs.txt
Steps and code to reproduce issue
Recommended: Set environment flags
GRPC_VERBOSITY=debug GRPC_TRACE=all
for better observation of gRPC activity.Launch Node program with at least one firestore listener.
Block internet traffic at the router or apply firewall rules blocking internet traffic to/from your device or over the specific connection to firestore backend to simulate silently killed network connection.
Observe how long it takes for a message such as the following to appear:
It appears, based on tcpdump, that the Firestore client doesn't even send keepalives to the backend server. The server sends keepalives every 45 seconds, but the client is either unable to or not configured to monitor for a certain number of missed keepalives before trying to reconnect.
In my test case, it took 32 minutes before the ECONNRESET was triggered by Node leading gRPC to start trying to reconnect.
Once the block is removed and the device is allowed to reconnect, even once the gRPC keepalives started flowing again, my Firestore listeners never started working again.
The text was updated successfully, but these errors were encountered: