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

RPC processing over socket delays pong response #885

Open
vyacheslav-sozap opened this issue Jul 15, 2022 · 2 comments
Open

RPC processing over socket delays pong response #885

vyacheslav-sozap opened this issue Jul 15, 2022 · 2 comments

Comments

@vyacheslav-sozap
Copy link

Description

When RPC is processed over socket connection, that may result in socket disconnection, even if no timeouts reached, because client receiving no "pong" response for his "ping" request, probably because RPC processing is blocking it.

If run long enough RPC call with low client keep alive timeout, this issue is almost stable, but for many cases it's just often firing, not absolutely stable.

Steps to Reproduce

Example:

  1. Make socket connection
  2. Run long processing RPC

Expected Result

RPC processing failed, cause socket has been closed

Actual Result

RPC processing succeed

Your Environment

  • Nakama: 3.12.0
  • Database: PostgreSQL from Docker image postgres:13.6-alpine
  • Environment name and version: Docker image heroiclabs/nakama:3.12.0
  • Operating System and version: WSL2 on Windows 10

Note

My guess is that problem is in this loop structure:
https://github.com/heroiclabs/nakama/blob/master/server/session_ws.go#L196

It's waiting for rpc to be processed in order to call "ReadMessage", and "ping" is probably handled there. If parallel rpc processing from socket is not wanted, maybe we can make a separate message queue in order to handle system frames before they expire.

@mofirouz
Copy link
Member

Hi @vyacheslav-sozap thanks for reporting this. Out of curiosity, what SDK are you using in your game?

@vyacheslav-sozap
Copy link
Author

I got it using nakama-dotnet 3.4.0

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

No branches or pull requests

2 participants