-
Notifications
You must be signed in to change notification settings - Fork 326
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
Bunch 'O Shutdown Fixes #2492
Bunch 'O Shutdown Fixes #2492
Conversation
`ALooper_pollAll` with a 0 timeout returns immediately.
36b2997
to
c1a39d8
Compare
cmd/gapir/cc/main.cpp
Outdated
@@ -143,6 +143,46 @@ std::unique_ptr<Server> Setup(const char* uri, const char* authToken, | |||
|
|||
#if TARGET_OS == GAPID_OS_ANDROID | |||
|
|||
namespace { | |||
|
|||
#define JNI_CALL_O(obj, name, sig, ...) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to see this as a template, rather than a macro.
Pardon my bad pseudo-code and making up names of JNI api things:
template<typename... Args>
jobject jni_call_o(Env* env, clazz obj, const char* name, const char* sig, Args&&... args) {
return env->CallObjectMethod(obj, env->GetMethodIf()......, std::forward<Args>(args)...);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but I would really prefer to see the Macro turned into a template, since macros make me sad.
c1a39d8
to
6a2fc9f
Compare
Don't drop log messages on exit on the floor.
`session.close` invokes the callback from `getOrCreateSession`, which aquires the mutex. Thus `session.close` has to be called without holding the mutex.
Usually gapir is shutdown, when gapis is shutting down, which means the context is cancelled, and gRPC would ignore it.
`rpcServer->Shutdown` blocks until all RPCs have finished. Calling it from within an RPC, well, deadlocks. Also correctly sets and fixes the usage of the `mShuttingDown` latch.
6a2fc9f
to
18d3460
Compare
The
gapis
andgapir
shutdown handling was, well, quite broken. This fixes things. The most noticeable thing this fixes is Androidgapir
: it no longer uses a full core while idling and the app will exit when the client exits.gapis
fixes:Shutdown
RPC togapir
.gapir
fixes:ALooper_pollAll
call, because 0 causes it to return immediately and the tight loop causes a full core to spin.gapir
exits.Shutdown
RPC request.