diff options
author | Craig Tiller <ctiller@google.com> | 2016-12-02 13:22:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-02 13:22:37 -0800 |
commit | 1747055e145f45057887fc6743a33b4ace85331b (patch) | |
tree | 7dbbde697ca7c86a0fc5ba5e4416e442cc43b121 /src/core/lib | |
parent | eaa6202ac931dc736479948f76fba829e09dacb4 (diff) | |
parent | 13b9a9a5f59105d62518013e03335bd379ae9c3f (diff) |
Merge pull request #8931 from ctiller/fixit20
Remove resource users from reclaimer lists when shutting down
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/iomgr/resource_quota.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/resource_quota.c b/src/core/lib/iomgr/resource_quota.c index 379bf9bd23..16392020f4 100644 --- a/src/core/lib/iomgr/resource_quota.c +++ b/src/core/lib/iomgr/resource_quota.c @@ -144,6 +144,12 @@ struct grpc_resource_quota { /* Closure around rq_reclamation_done */ grpc_closure rq_reclamation_done_closure; + /* This is only really usable for debugging: it's always a stale pointer, but + a stale pointer that might just be fresh enough to guide us to where the + reclamation system is stuck */ + grpc_closure *debug_only_last_initiated_reclaimer; + grpc_resource_user *debug_only_last_reclaimer_resource_user; + /* Roots of all resource user lists */ grpc_resource_user *roots[GRPC_RULIST_COUNT]; @@ -340,6 +346,9 @@ static bool rq_reclaim(grpc_exec_ctx *exec_ctx, resource_quota->reclaiming = true; grpc_resource_quota_internal_ref(resource_quota); grpc_closure *c = resource_user->reclaimers[destructive]; + GPR_ASSERT(c); + resource_quota->debug_only_last_reclaimer_resource_user = resource_user; + resource_quota->debug_only_last_initiated_reclaimer = c; resource_user->reclaimers[destructive] = NULL; grpc_closure_run(exec_ctx, c, GRPC_ERROR_NONE); return true; @@ -476,6 +485,8 @@ static void ru_shutdown(grpc_exec_ctx *exec_ctx, void *ru, grpc_error *error) { GRPC_ERROR_CANCELLED, NULL); resource_user->reclaimers[0] = NULL; resource_user->reclaimers[1] = NULL; + rulist_remove(resource_user, GRPC_RULIST_RECLAIMER_BENIGN); + rulist_remove(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE); } static void ru_destroy(grpc_exec_ctx *exec_ctx, void *ru, grpc_error *error) { |