Skip to content
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

Binder: recycle PendingAuthListener's executor during transport termination #10897

Open
mateusazis opened this issue Feb 6, 2024 · 0 comments

Comments

@mateusazis
Copy link
Contributor

This is a follow-up to #10566.

(note: I'm describing the issue as I recollect it; Chat ate the discussion thread. @markb74 please correct me if I'm wrong)

#10633 introduced the PendingAuthListener class and the logic to handle AsyncSecurityPolicy without blocking any threads. This required an Executor to be passed to BinderTransportSecurity here. In the same PR, we added a shutdown listener to return that executor to the object pool during server shutdown (here).

@markb74 commented that this was sub-optimal, and we could instead return the executor during termination. One suggestion was to pass an Executor to BinderServer.start and reuse it throught that server's lifetime. I prototyped it in mateusazis@3f262ca, but ended up with a chicken-and-egg issue in BinderServerBuilder.build:

  • BinderTransportSecurity.installAuthInterceptor wants an Executor, but it will only be available on BinderServer after it is instantiated and started
  • BinderServer is only instantiated after the authorization interceptor gets installed

Any help here is welcome!

@ejona86 ejona86 added the binder label Feb 13, 2024
@sergiitk sergiitk added this to the Next milestone Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants