If a job to generate stats is already running (or is queued), the Event page should be in the loading state (e.g. "Please wait, crunching the numbers"). Currently the "Update data" button is still active, although I'm pretty sure it won't queue a new job when clicked.
Description
Related Objects
- Mentioned In
- T189915: Add a link to let people query for "All wikipedias"
T187399: Do some load testing with grant metrics to get an idea of what limits we should add - Mentioned Here
- T192742: Number of retained editors apparently still includes all editors, not just new editors
T192954: Add cronjob to regularly spawn any unstarted jobs that have been submitted to the queue
Event Timeline
My concern is that people might not understand why the button is in loading state/disabled. This might come across as a bug to them. Imagine you had no idea how Grant metrics works and you logged in to see a disabled button with that text. You still might be able to guess because you have a fair idea of how web apps and job queues work but not everyone does. :)
I'd say let's keep the button active and let them get the satisfaction of clicking it but we don't create a new job if one is ongoing.
No problem, but note that it does say "Please wait, currently crunching the numbers".
I had to do this because of the issue described at T192742#4155122 (slightly different than what's described in this task). Basically, if a job gets stuck, hitting the "Update stats" page reloads the page instantly, as if it were successful. This happened with a test event at WMCON, where they hit "Update stats" and assumed the numbers were correct when they weren't, and I was equally as confused. If it says a job is running we at least will know about it, and can suspect something is wrong after so much time has passed. T192954 will help this, because it should kill any jobs that are left running for X amount of time. Why the job actually failed I still don't know. We might also kill old jobs when the event page is loaded, instead of solely relying on the cron.
I see this as tantamount to how Quarry works, where when you submit a query it says one of the states "Your query is waiting to be executed" or "Your query is running". For us we have the messages "The statistics are waiting to be generated..." and "Please wait, currently crunching the numbers...". Hope this is OK!
Okay. Although my gut feeling is that if jobs are getting stuck, we should be solving that problem instead of giving users the message about the job running already. But I don't mind it. We'll hear from users if this is confusing to them.