Coder Social home page Coder Social logo

Comments (10)

murgatroid99 avatar murgatroid99 commented on July 17, 2024

The channel argument to change the client idle timeout is grpc.client_idle_timeout_ms, not grpc.idle_timeout_ms. That's why it uses the default value in your test.

This is a bug caused specifically by the unix: URL scheme, which is why we didn't catch it before. The fix for that bug is in #2750, and I will publish that soon.

from grpc-node.

vamsideepak avatar vamsideepak commented on July 17, 2024

@murgatroid99 I have done the below options

const keepAliveOptions = {
      'grpc.client_idle_timeout_ms': 31536000000, // One year in milliseconds
      'grpc.keepalive_time_ms':31536000000,
      'grpc.keepalive_timeout_ms': 31536000000,
      'grpc.keepalive_permit_without_calls':1,
      
    }

Now unary calls are working fine but streaming is not working until I refresh the my application.

from grpc-node.

murgatroid99 avatar murgatroid99 commented on July 17, 2024

What do you mean "streaming is not working"? What actual problem are you experiencing?

Also, the bug has been fixed, so you should upgrade to @grpc/[email protected] and revert the grpc.client_idle_timeout_ms setting. I also recommend setting more useful keepalive settings, now that we know that keepalives are not the cause of the problem. 1 minute is a reasonable value for the keepalive time, and 20 seconds is the default value for the keepalive timeout.

from grpc-node.

vamsideepak avatar vamsideepak commented on July 17, 2024

@murgatroid99 Just now upgraded to @grpc/[email protected] and checking on it .

Initial problem:
My client is idle for sometime like almost 1 hour and after that if I make Grpc call to the server then it is not happening , and to make it work I need to restart my client then only it is working again.

After some Changes:
I have added the below configurations for keep alive and after this if client is idle for 1 hour then I am not able to receive any streaming calls data.

const keepAliveOptions = {
      'grpc.client_idle_timeout_ms': 31536000000, // One year in milliseconds
      'grpc.keepalive_time_ms':31536000000,
      'grpc.keepalive_timeout_ms': 31536000000,
      'grpc.keepalive_permit_without_calls':1,
      
    }

Note: I am using the named Pipe communication.

How can I make my client alive until the server is down ... ? My client calls needs to work until the grpc server is down.

from grpc-node.

murgatroid99 avatar murgatroid99 commented on July 17, 2024

I suggest that you try the following configuration

const keepaliveOptions = {
  'grpc.keepalive_time_ms': 60000
}

with all of the other options unset.

from grpc-node.

vamsideepak avatar vamsideepak commented on July 17, 2024

@murgatroid99 Thanks for your inputs . I will close this once everything is working fine on my end after testing with recent upgrade of grpc.

from grpc-node.

vamsideepak avatar vamsideepak commented on July 17, 2024

Upgraded to @grpc/[email protected] and I made Client 30 minutes IDLE and then tried to call the server grpc method, but it is not giving any response . After calling I am showing modal popup on UI and it struck there only. I do not know how to make client calls alive until the grpc server is down.
I have done following configurations as you mentioned.

const keepaliveOptions = {
  'grpc.keepalive_time_ms': 60000
}

I want my client to remain active even if it's idle for a day or two without any calls. It should be ready to make calls whenever I trigger the gRPC server methods.

Temporary solutions I found:

  1. Client need to reconnect to the Server
    2.Server should restart once without restarting the client
    By making above changes everything works well again.

from grpc-node.

murgatroid99 avatar murgatroid99 commented on July 17, 2024

I think we need more information to determine what is causing this problem. Can you run your client and server with the environment variables GRPC_TRACE=all and GRPC_VERBOSITY=DEBUG, perform the test that results in this problem, and share the output?

from grpc-node.

vamsideepak avatar vamsideepak commented on July 17, 2024

@murgatroid99 sure will do that and update here.

from grpc-node.

vamsideepak avatar vamsideepak commented on July 17, 2024

@murgatroid99 This has been tested and working fine . Thanks for all the quick response. Happy coding.

from grpc-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.