You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[#26672] docdb: Fixed deadlock on cleaning expired PG sessions when pg_client_use_shared_memory is on
Summary:
Faced on a 2024.2.2.1-b7 cluster with running YSQL workload and `--pg_client_use_shared_memory=true`.
All 4 threads of `iotp_TabletServer` threadpool are waiting inside `ScheduledTaskTracker::CompleteShutdown()`.
All of them are waiting for `big_shared_mem_expiration_task_.CompleteShutdown()`.
`big_shared_mem_expiration_task_` was scheduled but not launched due to `iotp_TabletServer` pool is busy with processing `PgClientServiceImpl::Impl::PgCheckExpiredSessions` and all `PgCheckExpiredSessions` are waiting inside `ScheduledTaskTracker::CompleteShutdown()` for `big_shared_mem_expiration_task_ to` complete.
Added unit-test to reproduce this issue and implemented fix.
Also updated `ScheduledTaskTracker` logs for easier debugging in future.
Logs before update:
```
I0401 17:00:43.968747 3586401 scheduler.cc:230] Waiting 1 tasks to complete
```
After update:
```
I0404 19:42:28.436432 1233831 scheduler.cc:231] big_shared_mem_expiration_task(0x000073c0bed8dcd8): Waiting 1 tasks to complete
```
Jira: DB-16052
Test Plan: PgConnTest.SessionExpiration
Reviewers: sergei, amitanand
Reviewed By: sergei, amitanand
Subscribers: yql, ybase
Tags: #jenkins-ready
Differential Revision: https://phorge.dev.yugabyte.com/D42981
0 commit comments