Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 2.7.0
Description
In ImpalaServer::GetRuntimeProfileStr(), we hold the query_exec_state_map_lock_ while serializing the runtime profile.
https://github.com/apache/incubator-impala/blob/master/be/src/service/impala-server.cc#L568
The SerializeToArchiveString() is a slow operation and is called at least once per query. We don't need to hold the map lock, we can instead take a shared_ptr reference and hold the individual exec_state lock while serializing the runtime profile.
If the query gets unregistered during the serialization operation, it will wait on the exec_state lock in QueryExecState::Done() until the serialization is complete.
https://github.com/apache/incubator-impala/blob/master/be/src/service/query-exec-state.cc#L526