Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Error feedback for "Long running job detected" errors is unhelpful

Discussion in 'Entity Component System' started by Zec_, Mar 2, 2020.

  1. Zec_

    Zec_

    Joined:
    Feb 9, 2017
    Posts:
    148
    Two weeks or so ago I started seeing these pop up occasionally during playmode. The errors have no feedback for which job is the cause of the issue.

    upload_2020-3-2_10-31-44.png

    I have no idea what this hints at. Here are some things I've noted:
    • The Jobs section in the profiler shows no long-running jobs.
    • I can't see anything noticeably wrong during runtime.
    • I think it started occurring sometime after updating to Entities 0.6 and Unity 2020.1.a024+ or something, but it's very random, so I'm having a hard time figuring out what started causing it.
    It would be really helpful to provide more information for these kinds of errors, if possible. I'll write again if I ever find out what's causing it.
     
    phobos2077 and alexeyzakharov like this.
  2. Zec_

    Zec_

    Joined:
    Feb 9, 2017
    Posts:
    148
    I was able to confirm an important aspect of it that makes me believe it has nothing to do with my code:
    • It occurs on some workstations/checkouts, but not on others. I've got two checkouts, where one gets it constantly and one doesn't get it. No local changes in either.
    I therefore suspected it had to do with the caches in the Library folder or similar, so I deleted it all and reimported the checkout that had the issue. Now it no longer occurs.
     
  3. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    89
    What exactly was it that you deleted? I am experiencing the same issue.
     
  4. Zec_

    Zec_

    Joined:
    Feb 9, 2017
    Posts:
    148
    Unfortunately, I'm back to having it again. I seemed to get rid of it for a short while by deleting the Library foder to reset the caches (requires a full reimport of the project).
     
  5. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    89
    Hmm. Perhaps this is a unity bug? I haven't tried an empty project run to test if its my project or not.. but if you are experiencing it aswell, then chances are its a bug.

    The full error is as follows:

    Long running job detected: Thread "Profiler.Dispatcher" in frame 1729 must have been in sync with the Main Thread, but it did not flush data for 50 frames and might be frozen.
    Discarding thread data.
    Previous 5 samples:
    <Root>
    In the scope:
    <Root>
     
  6. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    Thanks for reporting the issue!
    The error message has been added recently to notify that profiler discards data from threads which run long jobs. Before we were silently discarding the data.
    Atm ProfilerWindow waits for all data to come through in order to visualize frame, so if there is some job running for too long you get the error message. And (the bug part) I believe it happens when job worker thread is idle.
    We'll improve an error message and fix the bug.
     
    phobos2077 and MartinTilo like this.
  7. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    89
    Thank you for replying.

    So is it something I am doing wrong? Have I created the long running job? if so, its less of a bug and more of a game breaker in my case... This seems to happen 20% of my runtime, and this is a new project.
     
  8. Dinamytes

    Dinamytes

    Joined:
    Nov 3, 2016
    Posts:
    51
    Same, NavMesh.Builder
     
    phobos2077 and alexeyzakharov like this.
  9. CreativeUrge

    CreativeUrge

    Joined:
    Jun 22, 2019
    Posts:
    4
    Experiencing the same issue with 2019.3.4
     
    alexeyzakharov likes this.
  10. sroq

    sroq

    Joined:
    Jun 28, 2015
    Posts:
    13
    Same issue.

    Unity 2019.3.5f1



    upload_2020-3-21_19-47-6.png
     
    alexeyzakharov likes this.
  11. Slimer37

    Slimer37

    Joined:
    Sep 19, 2019
    Posts:
    1
    I got the same thing. 2019.3.5f1.
     
    alexeyzakharov likes this.
  12. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    Thank you for highlighting this - the fix is coming
     
    phobos2077, MlleBun and Dinamytes like this.
  13. MlleBun

    MlleBun

    Joined:
    Sep 19, 2017
    Posts:
    163
    Had the same issue today with the latest unity version. Quitting Unity and relauncing the project seems to fix the issue.
     
    saisam346 likes this.
  14. Whipexx_DigitalSun

    Whipexx_DigitalSun

    Joined:
    Aug 8, 2017
    Posts:
    17
    Hi there,
    This or a very similar issue is happening on some machines that run the project I'm working on, although most seem unaffected. Unity version is 2019.3.5f1.
    In our case it's not some Job.Worker, its "NavMesh Builder.Worker 0".
    We are using the NavMesh building components (probably not related) and the UnityEngine.Experimental.AI (probably related).

    On the machines that experience this issue, we seem to be getting agents that get stuck and are unable to properly calculate paths; although that still needs more investigation as I am yet to confirm that the job issue is the culprit and not the other way around.
    EDIT: Can confirm that the previous statement is not true, the issue I was experiencing is unrelated to the Job issue. The Job.Worker issue is persisting even after a clean install though.

    Does any patch already contain a fix for the issue? Do you think mine is related to a different issue? Should I report it as a new issue on the tracker?
     
    Last edited: Apr 15, 2020
    sol-erides and alexeyzakharov like this.
  15. Umresh

    Umresh

    Joined:
    Oct 14, 2013
    Posts:
    56
    Hi, Using unity 2019.3.5f1 and we are experiencing same issue while playing video from url on Video Player component.
    [Log]
    Code (CSharp):
    1. long running job detected: thread "." in frame 0 must have been in sync with the main thread, but it did not flush data for 50 frames and might be frozen. discarding thread data.
    Is there any fix for this?
     
  16. kfrancart42

    kfrancart42

    Joined:
    Mar 25, 2020
    Posts:
    1
    Using unity 2019.3.7f, this happens on Job.worker 0-6 and then repeats. This is only when building on an Android Galaxy Tab A with a development build and the profiler launching automatically. To clarify, that is just a build target, not only happening on the Galaxy Tab, only when building on a target device. I am using Addressables and they are working for JSON, music and spell fx. There are no such issues when making a Windows build.
    ----
    Long running job detected: Thread "Job.Worker 5" in frame 2 must have been in sync with the Main Thread, but it did not flush data for 50 frames and might be frozen.
    Discarding thread data.
    Previous 5 samples:
    <Root>
    In the scope:
    <Root>
    ----
    Does anyone have a clue as to what is happening?
     
    Last edited: Apr 18, 2020
    alexeyzakharov likes this.
  17. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,431
    To anyone experiencing this issue, please update to one of these:
    2019.3.10
    2020.1.0b6 (whenever it is published)
    2020.2.0a7
     
  18. dmitryzenevich

    dmitryzenevich

    Joined:
    Jun 9, 2017
    Posts:
    4
    Problem is gone when I deleted this code:
    Code (CSharp):
    1.  
    2. using System;
    3. using System.Collections;
    4. using UnityEngine;
    5. using UnityEngine.Networking;
    6.  
    7. public class GetConfig : MonoBehaviour
    8. {
    9.     private void Update()
    10.     {
    11.         if (Input.GetKeyUp(KeyCode.Space))
    12.             Request();
    13.     }
    14.  
    15.     public void Request()
    16.     {
    17.         StartCoroutine(GetConfigCoroutine((b, s) => Debug.Log(s)));
    18.     }
    19.  
    20.     private IEnumerator GetConfigCoroutine(Action<bool, string> callback)
    21.     {
    22.         WWWForm form = new WWWForm();
    23.         form.AddField("key1", "value1");
    24.         form.AddField("key2", "value2");
    25.         form.AddField("key3", "value3");
    26.         form.AddField("key4", "value4");
    27.         form.AddField("key5", "value5");
    28.         form.AddField("key6", "value6");
    29.  
    30.         using (var www = UnityWebRequest.Post("https://somesite.com/api/config", form))
    31.         {
    32.             yield return www.SendWebRequest();
    33.  
    34.             if (www.isNetworkError || www.isHttpError)
    35.             {
    36.                 Debug.Log(www.error);
    37.             }
    38.             else
    39.             {
    40.                 Debug.Log("Get config complete!");
    41.                 callback?.Invoke(www.isHttpError == false, www.downloadHandler.text);
    42.             }
    43.         }
    44.     }
    45. }
    46.  
    47.  
     
  19. canyon_gyh

    canyon_gyh

    Joined:
    Aug 15, 2018
    Posts:
    48
    I get this Error In Unity2019-3-7f1
     
  20. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,431
    yes, that is expected as the bug was fixed in 2019.4.10f1