fix connection cache race condition