[187] Cancelling mod download does not cancel and loads world while in world

Digi shared this bug 16 months ago
Considered

Sometimes loading a world doesn't download the single non-local mod I have in there (textAPI), so I cancel and try again, then it loads instantly.


The problem is the first mod downloading wasn't actually cancelled and when that finishes my world suddenly reloads.


I had this sudden world reload happen 3 times now, but the mod download not progressing at least twice that.


Relevant part of the log, see how it gets loaded, finishes mod download and then unloads:

2018-08-03 21:27:34.502 - Thread:   1 ->  Session loaded
2018-08-03 21:27:34.502 - Thread:   1 ->  RunLoadingAction - END
2018-08-03 21:27:34.502 - Thread:   1 ->  MyGuiScreenGamePlay.LoadData - START
2018-08-03 21:27:34.607 - Thread:   1 ->  MyGuiScreenGamePlay.LoadData - END
2018-08-03 21:27:34.608 - Thread:   1 ->  MyGuiScreenGamePlay.LoadContent - START
2018-08-03 21:27:34.608 - Thread:   1 ->  MyGuiScreenGamePlay.LoadContent - END
2018-08-03 21:27:34.636 - Thread:   1 ->  Updating continues.
2018-08-03 21:27:34.819 - Thread:   1 ->  GC Memory: 996,511,128 B
2018-08-03 21:27:37.156 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - START
2018-08-03 21:27:37.156 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - END
2018-08-03 21:27:44.616 - Thread:   1 ->  MyGuiScreenCubeBuilder.ctor START
2018-08-03 21:27:44.616 - Thread:   1 ->  MyGuiScreenCubeBuilder.ctor END
2018-08-03 21:27:44.616 - Thread:   1 ->  MyGuiScreenCubeBuilder.ctor START
2018-08-03 21:27:44.711 - Thread:   1 ->  MyGuiScreenCubeBuilder.ctor END
2018-08-03 21:27:46.579 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - START
2018-08-03 21:27:46.580 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - END
2018-08-03 21:27:49.781 - Thread:   1 ->  Downloaded file: ugcHandle=925926525720439329; size=2465796B
2018-08-03 21:27:49.798 - Thread:  12 ->     Mod download time: 60.03 seconds
2018-08-03 21:27:49.798 - Thread:  12 ->  Downloading world mods - END
2018-08-03 21:27:49.812 - Thread:   1 ->  LoadSession() - End
2018-08-03 21:27:49.813 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - START
2018-08-03 21:27:49.813 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - END
2018-08-03 21:27:49.813 - Thread:   1 ->  MyGuiScreenGamePlay.UnloadContent - START
2018-08-03 21:27:49.814 - Thread:   1 ->     MyGuiScreenBase.UnloadContent - START
2018-08-03 21:27:49.814 - Thread:   1 ->     MyGuiScreenBase.UnloadContent - END
2018-08-03 21:27:49.930 - Thread:   1 ->  MyGuiScreenGamePlay.UnloadContent - END
2018-08-03 21:27:49.930 - Thread:   1 ->  MyGuiScreenGamePlay.UnloadData - START
2018-08-03 21:27:49.931 - Thread:   1 ->  MyGuiScreenGamePlay.UnloadData - END
2018-08-03 21:27:49.932 - Thread:   1 ->  MyGuiScreenLoading.LoadContent - START
2018-08-03 21:27:49.932 - Thread:   1 ->  MyGuiScreenLoading.LoadContent - END
2018-08-03 21:27:50.033 - Thread:   1 ->  RunLoadingAction - START
2018-08-03 21:27:50.038 - Thread:   1 ->  Used namespaces in scripts:
2018-08-03 21:27:50.042 - Thread:   1 ->  MySession::Unload START


This doesn't seem to happen if there are multiple mods and you cancel before the last, It's likely that you need to cancel at exactly the last mod.


And I don't have a reliable way to reproduce this. This is probably one of those things that with specific info you can kinda see the issue by looking at the code...

Comments (4)

photo
1

I thought I found a reliable way of replicating this and then it was no longer reliable, I'm starting to think that hang is tied to steam, but regardless that still doesn't excuse the game from handling it poorly by not cancelling the task when I hit cancel and then all the sudden load another world when I'm already in a world.


So what I did was:

1. Create an empty world with only this mod: TextAPI (probably works with any one mod)

2. Exit the game entirely (to desktop).

3. Start the game and as soon as the menu is visible go to load world and load that world you created earlier.

4. It should now hang at this window.


If it doesn't hang, try from step 3 again later.

If it does hang, you could click cancel and load the world again, it should instantly load and then wait around looking at it until it gets reloaded on its own... but that sounds like a waste of time, just look at the code for it =)

photo
2

Hello Digi,thanks for your report. Issue reproduced.

photo
1

Maybe related to the mentioned bug. I've experienced the following:

1. Trying to join a MP server that has lots of mods (2+ GB), most of which I have not subscribed to.

2. Being presented to the "Downloading Mods" dialog...

3. Figures it will take too long to download all those mods, so presses 'Cancel'.

4. In the main-menu, presses 'Exit to Windows' to completely stop/leave the game.

5. When getting back to the Windows desktop, observes that Steam (and Windows TaskManager) still have SpaceEngineers.EXE running. - Uhm? But didn't I just leave the game?


Perhaps the game-engine have not properly ensured that all its worker-threads and (pending/queued) sub-tasks are stopped/aborted/cancelled, before returning to the Windows desktop?

photo
1

I am experiencing this as well with multiple mods loaded (2.5Gb).