-
Notifications
You must be signed in to change notification settings - Fork 62
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
add more flexible support for long running callback handlers #52
base: main
Are you sure you want to change the base?
add more flexible support for long running callback handlers #52
Conversation
putting to draft until i get tests regressions addressed |
Codecov Report
@@ Coverage Diff @@
## main #52 +/- ##
==========================================
+ Coverage 37.83% 38.82% +0.98%
==========================================
Files 28 28
Lines 2080 2102 +22
==========================================
+ Hits 787 816 +29
+ Misses 1293 1286 -7
Continue to review full report at Codecov.
|
@tsloughter I am curious to get your views on this change, mainly in relation to handling msgs in the stream context as opposed to spawning a new process. As noted above it is a breaking change ( maybe i can resolve that but at this point not sure )....honestly I am not sure where this lib is in its life cycle and its usage in the erlang community. Maybe a breaking change is an absolute blocker, maybe you just dont like this approach or maybe you think it has some legs. Anyway appreciate any thoughts you have on this. |
09e244f
to
d21c1ac
Compare
bdd8694
to
550c2b6
Compare
9f777ad
to
5698251
Compare
Did you run into some issues with shutdown or socket closing that led to your most recent commit? |
244bd9b
to
da0ec1e
Compare
@tsloughter We were seeing the grpcbox_socket process go down sporadically, and during init it would fail to restart as it hit eaddrinuse. The only scenario in which I can reproduce locally is by killing the process and forcing terminate to be bypassed. If this happens the server will fail to restart and end up breaking the sup restart strategy ( which was default, 1, 5), rending grpcbox effectively down. I cannot determine at this point why the process might be being killed in the wild. Logs only indicate an enotconn error as being the earliest event which in itself should not be a problem. I suspect there is more going on, but the blunt fix above gets things up and running again and keeps users connected |
41daec2
to
b92d38b
Compare
3f2f30a
to
9ed629c
Compare
update plugin version
…dler & related tidy up update tests to use functional handlers. apply same to reflection service use forked chatterbox with trailer race condition fix
bump chatterbox, silence invalid_preface error logging
bump chatterbox
bump acceptor pool for more fixes upgrading acceptor_pool dep
9ed629c
to
acc70e0
Compare
acc70e0
to
1c5c9fb
Compare
Linked grpcbox_plugin PR: tsloughter/grpcbox_plugin#15
These changes originate from use cases encountered at helium and in integrating this lib into the helium stack.
NOTE: This PR introduces breaking changes for any existing services. Handlers would be required to be updated. I suspect this may be a blocker for this PR, however I am keen to hear thoughts. If it is a blocker I can recut a separate PR with only the necessary changes ( supporting props & maps in the service definitions )
The changes here have been tested as part of the helium stack and using another erlang grpc client from Bluehouse Technology.
Change Summary
Dont spawn off streaming RPC handlers and instead handle server side incoming msgs within the stream process. This allows for ( albeit a somewhat subjective opinion ) better structured handlers which can more easily maintain their own state. Obviously it also has the benefit of reducing the overall process count for each stream and removes the overhead in managing the spawned process ( such as handling their various exit signals ) and in exchanging msgs between the stream and spawned handler process.
Allow application callback handlers to define, initialize & maintain their own state within the context of the grpcbox stream. Thread state to all handler calls.
Allow info messages to be threaded from stream to application callback handlers.
Handle PB service names as either maps or props
TODO: