Skip to content

Add grpc keep alive for management service#771

Closed
pappz wants to merge 8 commits into
mainfrom
feature/keep_alive
Closed

Add grpc keep alive for management service#771
pappz wants to merge 8 commits into
mainfrom
feature/keep_alive

Conversation

@pappz
Copy link
Copy Markdown
Collaborator

@pappz pappz commented Mar 28, 2023

Describe your changes

Application level keep alive PoC for gRPC.

The concept is that mgmt server send the keep alive messages
periodically.
Because the current setup does not support the both way communication
the server inject keep alive (empty) messages in the Sync stream. So
the keep alive procedure will start after the Sync call happens.

The application level keep alive will be applied only on that case when the
server is behind reveres proxy. The server check it with the proper
HTTP headers to ensure to necessary this feature or not.

Because in the client has a bug what can cause exception I involved
the version information into the gRPC function calls and the server
send keep alive messages only if it is supported by the client.

Example nginx config:

server {
  listen *:80 http2;

  server_name signal.localhost;

  location / {
    grpc_set_header x-netbird-peer '$remote_addr:$remote_port';
    grpc_pass grpc://0.0.0.0:82;
  }
}

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@ykorzikowski
Copy link
Copy Markdown

Is there an ETA when this feature will be ready? I am thinking to disable my rproxy for netbird until this feature is done. I see this issue is occuring more often since latest release.

@pappz pappz force-pushed the feature/keep_alive branch from 208c6e1 to 70076b9 Compare June 23, 2023 11:08
@pappz pappz force-pushed the feature/keep_alive branch from d19dd3a to 649dbf2 Compare June 26, 2023 10:47
@pappz
Copy link
Copy Markdown
Collaborator Author

pappz commented Jul 14, 2023

@ykorzikowski could you send me the version information of your proxy?

@pappz pappz closed this Aug 11, 2023
@pappz
Copy link
Copy Markdown
Collaborator Author

pappz commented Aug 11, 2023

This development is not actual any more. The modern versions of the proxy servers can support well the grpc.

@xiaolei0125
Copy link
Copy Markdown

@pappz I use Cloudflare proxy my netbird management and signal service, But netbird client got disconnect and reconnect every 100 second.

this caused by cloudflare 524 timeoout: https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-524-a-timeout-occurred.

Error 524 indicates that Cloudflare successfully connected to the origin web server, but the origin did not provide an HTTP response before the default 100 second connection timed out.

Can you continue add grpc keep alive for management and signal service ? Thanks!

@emperorkebab
Copy link
Copy Markdown

Same here, my connections are dropped every 75s because of the lack of this, please reconsider.

@pktiuk
Copy link
Copy Markdown

pktiuk commented Nov 30, 2024

This feature seems to be a good idea.

@iamnotbobby
Copy link
Copy Markdown

@pktiuk

I apologize for the year-later reply, but I'd love to see an implementation of keep-alive in gRPC. I'm running it behind Cloudflare and it can be a bit annoying having it fill up my logs.

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

Successfully merging this pull request may close these issues.

6 participants