I was trying to use Remote Config in an project and run into an issue.
The first time I start the game it works fine. The second time I start I get an System.IO.IOException: Sharing violation on path …\RemoteConfig.json (or RemoteConfigHeaders.json)
What seems to happen is that the ConfigManger tries to save the fetchedConfig while the cached config is still being read. So looks like this is a race condition that is dependent on hdd & network speed.
While I would really like to use Remote Config that is currently blocking me from using it as it has the potential to affect every user with a fast internet connection.
As a workaround I can delay the call to fetchConfig, hoping that the Init call has finished by then, but that is a workaround and not a solution.
Hi @SRH ,
Thanks for pointing that race condition out, we will start investigating on a fix ASAP, and take corresponding steps.
The problem you found is happening only in versions 1.1.0-preview and above.
As a temporary solution we made reading and writing to a cache file synchronous and we will apply that fix in the next release within few days (thanks @rambod )
However, we will revisit this issue shortly in the future and make it one of our top priorities.
@SRH we just shipped an update, 1.1.0-preview.3 that changed the async read/write to synchronous for now so the bug is resolved. Like @vd_unity mentioned, we’ll revisit this soon to add async read/write of the cache again. Thank you for reporting the bug!