[test] fix ASAN test failures in master-stress-test

The MasterStressTest occasionally failed in ASAN builds [1] [2]. I also built
the test in ASAN mode on a CentOS 7.9 machine, ran it in slow mode 3 times and
all failed.

It seems that some RetryingTSRpcTask is still running after 'TableInfo' object
destroyed if we set --enable_metadata_cleanup_for_deleted_tables_and_tablets=true.
To fix heap-use-after-free errors, we should abort and wait all pending tasks
completed before we destroy a TabletInfo object. With this fix the ASAN test
can pass 10 times.

[1] http://jenkins.kudu.apache.org/job/kudu-gerrit/25414/BUILD_TYPE=ASAN/
[2] http://jenkins.kudu.apache.org/job/kudu-gerrit/25448/BUILD_TYPE=ASAN/

Change-Id: I4eff45fbf05644362169485cd32678509eab1b07
Reviewed-on: http://gerrit.cloudera.org:8080/18501
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <alexey@apache.org>
1 file changed