Opened 9 years ago

Closed 8 years ago

#3446 closed defect (fixed)

[PATCH] Replay menu should react to the user trying to quit

Reported by: elexis Owned by: elexis
Priority: Must Have Milestone: Alpha 20
Component: Core engine Keywords: patch
Cc: Patch:

Description

As mentioned in #3433, it can take quite some time to initially read the commands.txt files on the harddisk (a minute on my machine).

Currently this process is uninterruptable as it doesn't react to SIGINT. You have to use SIGKILL, i.e. kill it with absolute force (kill -9 on linux).

Ideally people can just hit Alt+F4 or Ctrl+c to stop loading those files.

To reproduce the long loading time on linux, you have to drop the HDD cache using

echo 3 | sudo tee /proc/sys/vm/drop_caches

I agree that this long-loading isn't a big one, so it could be pushed to a20. On the other hand, users that don't know the source of this issue might panic.

We should also add the warning to the main menu in attachment:t3440_fix_main_menu_entry_add_warning_v2.patch:ticket:3440

Attachments (1)

t3446_catch_SDL_QUIT_v1.patch (2.1 KB ) - added by elexis 9 years ago.

Download all attachments as: .zip

Change History (5)

by elexis, 9 years ago

comment:1 by Stan, 9 years ago

Owner: set to elexis

comment:2 by Itms, 9 years ago

Milestone: Alpha 19Alpha 20

comment:3 by elexis, 8 years ago

Keywords: review removed
Priority: Should HaveMust Have
Summary: [PATCH] Cancel replay menu loading with Alt+F4[PATCH] Replay menu should react to the user trying to quit

Thanks Itms for taking a look at this patch few days ago!

  1. Patch above is broken: The patch above pulls all SDL events and ignores them unless it is a QUIT event. In that case it will return to the main menu, which is a bit weird. The other events not being processed after the loading of the replay menu is also weird.
  1. Found perfect patch: Further investigation revealed SDL_PeepEvents only checks if there is a matching event queued, but doesn't remove it. Browsing the documentation I found the file SDL_quit.h, which is included in SDL 1.2 and 2 and contains the exact same code SDL_QuitRequested()!
  1. This has to be fixed: because even when using cache file as proposed in #3433, the cache has to be built at some point, in which case it would also require a minute to load (i.e. when importing hundreds of replays or when the cache file was broken/lost).

comment:4 by elexis, 8 years ago

Resolution: fixed
Status: newclosed

In 17852:

Quit if the user requested that while loading the replay list. Fixes #3446.

Note: See TracTickets for help on using tickets.