8

In the First Answers review queue, it consistently takes 10+ seconds to load the next review, most of which is waiting on stackoverflow.com to return a response from a POST request to the /review/next-task endpoint. This doesn't happen on any other review queues that I have access to.

enter image description here


As per @cafce25's question in the comments: This is based on an unfiltered queue. If I filter by , , , however, then /review/next-task responds within ≈1.5s, which is totally acceptable. That provides a workaround for me, and possibly a pointer to the development team, but obviously not a solution.


Unfortunately, I don't recall when this first started exactly—though, judging from my review history, it appears to have been a couple of weeks ago.

(Since this started, the number of reviews I complete each day has gone from a consistent forty to a sporadic five or ten.)

The fact that there remain reviewers who do forty reviews a day could suggest that this isn't universal. For me, however, this behavior occurs on every (unfiltered) review, across devices, browsers, and connections, including in Incognito Mode in Chrome.

(I've tested on Safari and Chrome, on iOS and iPadOS, as well as on Windows 10 and 11. It therefore doesn't appear to be related to my browser, connection, or e.g. any caching or plugins.)

Is this a known issue? Is anyone else experiencing this?

I'm obviously happy to submit any of the request or response headers that would be useful here.

20
  • 1
    From a quick test, I can't reproduce this, but someone else who's not a moderator should probably try it.
    – Ryan M Mod
    Commented Sep 6 at 3:26
  • 1
    I can't reproduce this either, about half a second between tasks. Since you're seenig it across devices, it might be your connection, did you try a different one?
    – cafce25
    Commented Sep 6 at 3:27
  • @RyanM: Do you know what per-user considerations factor into this queue that might impact performance for me? It's worth noting I'm the top reviewer in the queue. Obviously, items only require one review to be moved out of the queue, so there shouldn't be any consideration of whether I've already reviewed an item. And as it only applies to a contributor's first answer, it shouldn't be based on e.g. a restriction on the number of reviews from a contributor one reviewer can review. And, regardless, as there are so many new first answers per day, I'd expect the queue to refresh pretty quickly. Commented Sep 6 at 3:42
  • @cafce25: That's a good question, and one I should have addressed in my original post. But, yes: This has happened across at least a half-dozen different connections. (Two residences, cellular, various cafes I've worked out of.) I've edited the post to clarify that. Commented Sep 6 at 3:46
  • One other thing that comes to mind, do you have any filters on? My quick test was done without any.
    – cafce25
    Commented Sep 6 at 3:59
  • @cafce25: Another good question. I totally forgot there were filters in that queue. But, no, I'm not using any filters. Commented Sep 6 at 4:00
  • @cafce25: I decided to play around with this. I added c#, java, and javascript, and found that the response time for /review/next-task was reduced from ≈8.5s to ≈1.5s. That's a dramatic improvement, and will at least allow me to continue doing reviews—yay! Though it obviously doesn't solve the original problem, it should be useful if the dev team chooses to take a look at this. Commented Sep 6 at 4:30
  • Hmmm, speculation: I wonder if it's somehow specific to people who've done a lot of reviews in a particular queue? It needs to filter out the reviews you've already done, plus the ones you've skipped, although I think the former doesn't really apply to First Answers... I tried skipping a few dozen reviews in FA to see if it slowed noticeably, and it didn't...and you don't appear to have skipped too many, at least recently.
    – Ryan M Mod
    Commented Sep 6 at 8:32
  • @RyanM I think it may well be related to the number of reviews - I'm top of the list on several queues and they can be very slow.
    – greg-449
    Commented Sep 6 at 9:12
  • I noticed some sluggishness when you first reported this, but it seems pretty snappy this morning. Any change for you? (I'm not a big reviewer, so volume may play less of a role for me, but it was noticeable.)
    – user25043454
    Commented Sep 6 at 11:13
  • 2
    @JeremyCaney Hi there, fixed an index, please try now.
    – Aaron Bertrand Staff
    Commented Sep 7 at 1:52
  • 2
    @AaronBertrand: Thank you for your attention! I'll need to wait until tomorrow when I have more reviews available, but I'll report back then. Commented Sep 7 at 2:48
  • 1
    @AaronBertrand: That seems like it may have done _something_—but, if it did, it unfortunately went the wrong way: The lag on next-task has gone from a consistent ≈8s to ≈11+s. It remains reasonably fast with filters applied, however. I'll leave a couple of reviews unclaimed today in case you're able to make any further changes, allowing me to test faster next time. Thanks for looking at this. Commented Sep 8 at 0:16
  • 4
    I'll have to keep investigating tomorrow. I observed the 8 second queries you experienced in our monitoring, and then was able to reproduce. There was an index that wasn't quite right because the query had changed over time. I fixed that, which generated a new plan, and then I was getting sub-second results consistently. I see the long-running executions you're seeing again today, but this time I can't reproduce them (in the database, with your user id, or on the site, obviously with my own). And every single long-running instance is for you and only on that queue, so, it's hard to nail down.
    – Aaron Bertrand Staff
    Commented Sep 8 at 1:54
  • 2
    @AaronBertrand: So this is interesting! I just retried it, and it's now quite performant—now just ≈250ms for the POST to /review/next-task! I won't pretend to know why I was initially getting the steep increase, but it now seems as though the changes you implemented have fixed the issue. (I've validated this on two different browsers/OSs/devices.) Thank you! Commented Sep 8 at 2:19

1 Answer 1

12

There was a perfect index for this query when it was first written, but it wasn't updated to account for changes to the query over time. The suitability of the index would only really be a problem for prolific reviewers - there are a handful with over 100K review results, and that's about where the query would fall over.

I made index adjustments over the weekend by adding a better index, which is less disruptive than changing an existing one - especially when other queries can continue using the original index efficiently. One of the execution plans was stubborn, and still picked up the old index, which explains why the OP didn't see any behavior change until I evicted that specific plan from the plan cache. Now it's picking up the new, better index.

I can no longer reproduce the issues for this specific review queue. Note that the index changes are tailored to the queries behind this queue, so there may still be other queues that are affected by similar contributing factors. We'll deal with those case-by-case - hopefully before any user experiences symptoms but, if you observe any sluggishness with a particular queue, please let us know.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .