Merge "Fix thread safety issue on clearing cache" into mainline-prod