Search Unity

Getting IOException: Sharing violation on path ...\RemoteConfig.json

Discussion in 'Unity Remote Config' started by SRH, Jan 9, 2020.

  1. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    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.

    Any chance to get that fixed in future releases?
     
  2. vd_unity

    vd_unity

    Unity Technologies

    Joined:
    Sep 11, 2014
    Posts:
    41
    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.
     
    Last edited: Jan 9, 2020
    rambod and SRH like this.
  3. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    That sounds great. Thanks for the fast reply.
     
    vd_unity likes this.
  4. rambod

    rambod

    Unity Technologies

    Joined:
    Mar 2, 2018
    Posts:
    58
    @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!
     
    vd_unity likes this.