retry grabbing aws credentials a couple of times + lock meta database before read and write