-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Create App context callback for timer custom #18898
Create App context callback for timer custom #18898
Conversation
ping @markdroth and @vjpai |
Do you have a test that fails without this and passes with it? Overall it looks good to me but I'd like to see it tested. |
@vjpai thanks for your review. Agree in an ideal world a test would be needed, indeed I have the feeling that this could be covered with a unit test instead of using a general end2end test. But I have the feeling - seeing the current code - that the following pattern is not explicitly tested in any place
As I was commenting there are other places where this fix needs to be applied, like So IMO we have different options:
Thoughts? [1]
|
hi, @vjpai any thoughts on that? Pending questions that I do have:
|
The csharp test fails after re-run. It might signal a true regression. |
I think the C# issue looks like a pre-existing one: I tried rerunning the test to see if the test is failing consistently. |
Seems that now are failing other tests ..... any suggestions on that? does it make sense on rebase this branch with the master one? Theoretically should make no difference ... but happy to do it if you prefer to diagnose a PR that is up to date with master. |
@pfreixes Rebase this PR is a good idea. |
When a timer reaches its deadline and it uses the combination of having enabled the custom timer and using a completion queue of callback type we must provide the App context callback at TLS level. Otherwise, a segfault is produced during the enqueuing process of the application callback.
9d93aaf
to
884b68c
Compare
done @lidizheng ! |
The internal presubmit tests is passed. Id for the change -> 258871136. |
Thanks for helping me on having this merged! |
When a timer reaches its deadline and it uses the combination of having
enabled the custom timer and using a completion queue of callback type we
must provide the App context callback at TLS level. Otherwise, a segfault
is produced during the enqueuing process of the application callback.
Resolves partially this issue #18721
What is missing?
Testing, before implementing it I would prefer on having the blessing on the intentionality of that PR and also some advice on how to implement a test for this PR.
I have the impression that test this fix should be doable at unit test level, so having an ad-hoc test into a new file that will basically call the
grpc_custom_timer_callback
function by mocking atimer->closure
function that would try to enqueue something into the application callback context.Another alternative is not doing any unit test at all considering that other commits related to that issue haven't considered it [1], maybe relying on a - future ? - end2end test?
Further work
If this PR is accepted future PR would be done for all of the custom iomgr files that lack, like
tcp_custom
ortcp_server_custom
, on the application context./cc @vjpai and @markdroth happy to hear your comments
[1] 85d76b2