You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that all signal handling logic was removed from GRPC::RpcServer and server now simply crashes when process is killed:
Ctrl+C
I, [2017-10-27T12:59:43.326558 #87078] INFO -- : Booting gRPC Server...I, [2017-10-27T12:59:43.329951 #87078] INFO -- : handling /grpc.health.v1.Health/Check with #<Method: Grpc::Health::V1::Health::Service#check>^Cbundler: failed to load command: gruf (/Users/user/.rbenv/versions/2.4.1/bin/gruf)Interrupt: /Users/user/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/grpc-1.6.6-universal-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:370:in `request_call' /Users/user/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/grpc-1.6.6-universal-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:370:in `loop_handle_server_calls' /Users/user/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/grpc-1.6.6-universal-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:331:in `run' /Users/user/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gruf-2.0.1/lib/gruf/server.rb:63:in `start!' /Users/user/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gruf-2.0.1/bin/gruf:27:in `<top (required)>' /Users/user/.rbenv/versions/2.4.1/bin/gruf:22:in `load' /Users/user/.rbenv/versions/2.4.1/bin/gruf:22:in `<top (required)>
SIGTERM
I, [2017-10-27T12:59:43.326558 #87078] INFO -- : Booting gRPC Server...I, [2017-10-27T12:59:43.329951 #87078] INFO -- : handling /grpc.health.v1.Health/Check with #<Method: Grpc::Health::V1::Health::Service#check>bundler: failed to load command: gruf (/Users/user/.rbenv/versions/2.4.1/bin/gruf)SignalException: SIGTERM /Users/user/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/grpc-1.6.6-universal-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:370:in `request_call'
With this monkey-patch Ctrl+C and SIGTERM are handled properly.
Gruf::Server.class_evaldoalias_method:orig_start!,:start!defstart!orig_start!rescueInterrupt,SignalException,SystemExitlogger.info{'Shutting down gRPC server...'}server.stopendend
I, [2017-10-27T12:59:43.326558 #87078] INFO -- : Booting gRPC Server...I, [2017-10-27T12:59:43.329951 #87078] INFO -- : handling /grpc.health.v1.Health/Check with #^CI, [2017-10-27T13:01:14.288286 #87184] INFO -- : Shutting down gRPC server...I, [2017-10-27T13:01:14.288537 #87184] INFO -- : stopping, will wait for all the workers to exitI, [2017-10-27T13:01:14.290172 #87184] INFO -- : schedule another jobI, [2017-10-27T13:01:14.292240 #87184] INFO -- : stopped, all workers are shutdown
Can I submit a PR to rescue these exceptions in Gruf::Server so we can remove this patch from all of our services or am I missing something here?
The text was updated successfully, but these errors were encountered:
Hey @Parad0X - apologies for the late reply, this seems to have slipped my inbox.
I've confirmed this - definitely needs addressing.
Definitely feel free to submit a PR if you want - I'll take a look tomorrow as well if you haven't gotten to it by then. Thanks for the detailed report!
It appears that all signal handling logic was removed from
GRPC::RpcServer
and server now simply crashes when process is killed:Ctrl+C
SIGTERM
With this monkey-patch
Ctrl+C
andSIGTERM
are handled properly.Can I submit a PR to rescue these exceptions in
Gruf::Server
so we can remove this patch from all of our services or am I missing something here?The text was updated successfully, but these errors were encountered: