Going to https://stackexchange.com/about/moderators seems broken; going to https://stackexchange.com/about and clicking the "moderators" link gets me to a nice picture of a panda falling on its head (AKA the "Oops! Something bad happened!" page).

enter image description here

While this isn't the highest traffic page, it's still interesting info and I'd like to be able to see it.


Well this was fun to debug. I changed this recently from a ton of API calls to direct DB queries as part of a massive HTTP overhaul we're doing internally (moving internal traffic to HTTPS).

In the method, it's now a Parallel.ForEach fetching many site moderators at once (we need data stored in each site's database). 3 methods down there was a "current context" access, which looks at, ultimately, the current request. This doesn't work in a background thread.

"Hey Nick, why don't you test your damn code?" Well I did, but locally and in dev (not visible to the public), there is at most 1 site in the loop. In .NET, a shortcut happens on Parallel.ForEach where it doesn't need to allocate all the sharding and parallelism bits...so it just runs on the current thread. Because of that, the "current context" access was fine. When it got to production with hundreds of sites: boom.

So, sorry about that. A fix has just finished deploying and all should be well.

| improve this answer | |
  • 7
    tl;dr: testing in production isn't just a good idea, it's the law. – Shog9 Jan 31 '18 at 16:10
  • 1
  • There's still something weird with it; searching for "Stack Overflow" pulls up only a foreign language site and searching for my username pulls up nothing. – Undo Jan 31 '18 at 20:03
  • Yet still only 33 out of 170 sites are showing... – Mithical Jan 31 '18 at 20:37
  • @Mithrandir sorry cache there (the ones on the main thread completed) - I did a manual purge just now to get everything back in order. – Nick Craver Jan 31 '18 at 20:40

You must log in to answer this question.

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