Search Unity

Bug [Addressables 1.19.9] Addressables freezing under a certain condition

Discussion in 'Addressables' started by MaskedMouse, Oct 20, 2021.

  1. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    I have a setup where a method is marked with
    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
    and it calls
    Addressables.LoadAssetAsync("Label")
    and then
    WaitForCompletion()
    .

    However, when I have Remote Catalog turned on with a Local Host that is not enabled
    the editor freezes (or if built, the app hangs).
    When I turn on the local host, it works normally.

    This behaviour causes for concern because when the server is unavailable, the app would hang.
    Setting a timeout does not work.

    When I debug it, it is infinitely looping in the WaitForCompletion. So I pause the debugging and force it to throw an exception. It then continues normally.
    It's as if Addressables hasn't been initialized yet. So which I tried calling
    Addressables.InitializeAsync
    and also WaitForCompletion, but I'd get the same loop.

    The bundle itself is configured to use the Built-In paths. So I expected it to load just fine as a Streaming Asset. But as soon as Remote catalogs are enabled, it freezes when the online location is not available.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    I believe you run into this issue: https://forum.unity.com/threads/cas...id-if-hosting-service-is-unreachable.1129265/

    If the hosting service is unavailable, most Addressable calls never return.

    You can workaround this bug by specifying a timeout greater than 0 for the "Catalog Download Timeout" property found in the AddressableAssetSettings, as well as for the "Request Timeout" in all AssetGroups.
     
    MaskedMouse likes this.
  3. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    I had tried the catalog timeout, but I haven't tried the asset groups. I'll see if I can try that today, if I have spare time.