Adds a Barrier after checking and updating the configuration file to avoid corrupting the configuration file. Former-commit-id: bddf71f81d55e9b0aef8e2579b8abc4a24e34f7b