158 comments

[ 48.3 ms ] story [ 3872 ms ] thread
All I can think about is the poor oncall engineer waking up to a latency alarm on a saturday night.
Google has offices in many timezones.
But the emoji search addin feature will be developed by a team in mountain view... So if emergency code changes need to be made for this bug HN has just found, they will still be woken up.
How do you know?
(comment deleted)
Any major product at Google has an on-call team with offices in multiple time zones. Typically, two engineers from different time zones will be on-call at any given time—they switch back and forth between primary and secondary, so nobody is primary on-call during the middle of the night, local time.

For example, you might have an SRE team in Mountain View, and an SRE team in Dublin. Maybe the engineer in Mountain View is primary on-call until midnight, and then it switches to the engineer in Dublin, who starts their shift at 8:00 AM.

If it’s getting code changes, it’s not getting code changes right now. The software engineers may be in Mountain View, but they won’t patch this and push out a new version during the night. Someone (read: an SRE) may change a configuration or push out a temporary fix now, and any code changes will only go out after significant testing. Generally speaking, you don’t hotfix high-profile production services. You rollback, you set up filters, you disable features, you turn off component services, you run in a degraded capacity—but if you want to actually change the code, you take your time and do it right. Rushing out a code change in the middle of the night is liable to make things worse, and nobody wants to do it.

For the right definition of "major". Search, Ads, GMail, Docs, absolutely. If you only have 50 million DAU then you may not even have an SRE let alone one in multiple time-zones. Most teams have an on-call rotation and you get a phone-call an hour after you fall asleep unless you recently did a push or go to bed early. (Or you just forget all the pages that happened during normal hours and only remember the annoying ones.)
Possibly, but probably not. Google tends to have follow-the-sun rotations staffed by SRE as the first line of defense, with an escalation path to devs if necessary.

SREs may not have intricate knowledge of the code but they have an array of tools that can mitigate problems, and they're software engineers too, so they can debug this themselves if need be. Their focus however won't be on fixing the bug, it will be on stopping the bleeding. Typically they'll check if this is an issue introduced in a recent rollout and roll that back. In the case of Search they also have an array of tactical tools - someone mentioned that a specific website was causing this, they probably have a way to quickly and temporarily delist this specific result.

The focus will be on recovering ASAP, figuring out the details and the long-term fix later. That later can be during business hours on Monday.

That depends, I don't think that there needs to be anything emoji specific (at the character level). It could be a special handler for inline results, marketing filters, etc that's gated on some variation of that string.

Might be worth seeing if there's another "how many X on iOS" that faults as well, because I would be that it reports an ISE on timeouts, and you could easily imagine some service making a follow on request that now times out.

It really depends on what is happening behind the scenes. Is it killing an entire server process or just an error in a single thread? Even if it kills an entire server process, Google has lots of these running and the ratio may not be high enough to page.
Why do you think so? Lots of important systems are developed in European offices at least, I wouldn't be surprised if some are in Asia as well. It isn't like Google search is only in MTV.
It's likely that there is some tool for blocking or rewriting certisn queries or results that trigger errors so that the code changes can be made with less rush, more testing and during business hours.
In some Sunday is a work day but not the most..
(comment deleted)
Ya somebody is getting paged right now.
and "ranked down"
Curious: are engineers at Google punished for mistakes? If so, in which cases?
No. That is insane to even think about. Google practices blameless postmortem processes that focuses on avoiding repeat incidents and fixing processes. This is not just something we write down in books but something we do on a daily basis and believe in it.

The only way I can think of someone being punished is, of course, it was maliciously done.

Disclaimer: I am a Google SRE, opinions my own, not an official comment.

(comment deleted)
My prediction is that engineers at Google will have been notified via Hacker News well before any internal system notifies them.
Not for 500s on the main search page. That'll trip a monitor; they're supposed to be rarer than helium.
I already reported this bug a couple days ago based on a similar query that a friend of mine to dome about.
DuckDuckGo is the answer then.
DDG is my default browser, this is the search result: https://duckduckgo.com/?q=how+many+emojis+on+iOS&t=fpas&ia=w...

The third sesrch result attempts to answer the question. The 1st and 2nd are related but not perfectly relevant.

Something to do with processing an unusually large number of emojis?

I wonder if processing emoji characters has any different performance characteristics than other UTF characters.

Server Error We're sorry but it appears that there has been an internal server error while processing your request. Our engineers have been notified and are working to resolve the issue.

Please try again later.

Fascinating. "How many bananas on iOS" and "how many emojis on Android", "emojis on iOS" work fine.

Maybe the quantity question is running into an error trying to make one of those cards? Incredible that it just crashes search though.

"crash" here is likely just how the frontend reports a backend timeout.
Including "how many" triggers an instant answer for sure.

Instant answer crawler tries to answer that question by parsing some site, fails in an unexpected way.

That'd be my theory.

Also happens if you replace "iOS" with "Windows".
It takes a while to load, but it doesn't give me a server error like "ios" does.
Taking a while to load is probably indicative of the problem.... There's probably some O(n^3) memory or compute complexity going on somewhere of the number of emojis on the page.

For example, I imagine Google uses as a final ranking step some stuff based on the similarity of the pages about to be returned - to make sure you aren't about to show the user two pages that are practically identical. That logic might try to build similarity mappings between the pages, and has logic that fails badly for large numbers of emoji.

I would guess it's the time that is the problem - whatever service would produce an inline answer is presumably falling over, and the subsequent timeout is reported as an error.
My guess is this is related to instant answers section at the top of the search results. It's trying to figure out the count, but it's failing for one reason or another.
Neeva for Safari loads with no problem. Wonder what makes Google wig out.
maybe this is a google joke. there are so many that they cannot calculate.
Have you tried to ask "show me the set of emojis which cannot be found by Google Search"? :-)
Well in Europe google.com returns a 500 error for that query, so crashes is the correct term for this.
following is shown to users:

> Server Error

> We're sorry but it appears that there has been an internal server error while processing your request. Our engineers have been notified and are working to resolve the issue.

> Please try again later.

this is a handled crash, but still a crash

Also breaks for

how many emojis are there on iphone

"how many emojis in ios" seems to trip it too

edit: so does "how many emojis ios" and "how many emojis apple" but not "how many emojis android"

Would be definitely interesting to read a report on what triggers this error! I don’t think it is a tile error as presumably the backend that collects all the answers would be set up in a way that is resilient to upstream errors. So maybe the core results compiler?
I'm not sure exactly how it works but if you look at the network requests for "how many emojis ios" vs "how many emojis android" the html for the initial page contains an internal server error whereas the android version contains some more javascript which contains the search results.
I don't think the public will ever learn what went wrong here, but whichever Googler fixes this will have one heck of a war story to tell over drinks.
The likeliest candidate is probably the final render step. Under the hood, search farms the query out to multiple backends, gathers partials from them, and then composites those partials into the final rendered page. For an actual 500 to surface to the user, that final compositing step is probably what fails; gathering and compositing are already robust against an individual backend failing to return a result.

I'm on board with other people's suggestions that asking a question like this is tripping over a site that surfaced an emoji in their site title that is choking the Unicode library that Google is relying upon.

Interestingly it crashes starting on "how many emojis on i"
"how many emojis on e" takes 5 seconds
"how many emojis on l" takes 5 seconds too
"how many emojis on p" also takes 5 seconds
"how many emojis on s" takes 5 seconds
"how many emojis on x" loads in 5 seconds
Works on Kagi. Must be superior.
Also works for "how many emojis iphone" but strangely not other platforms like Windows or Android.
Server Error We're sorry but it appears that there has been an internal server error while processing your request. Our engineers have been notified and are working to resolve the issue. Please try again later.
Interesting.

"how many emojis on ios" - error

"how many emojis on apple" - error

"how many emojis on windows" - error

"how many emojis on macos" - working

"how many emojis on lumia" - error

"how many emojis lumia" - error

"how many emojis on linux" - working

"how many ios emoji" - working (albeit slowly)

"how many emojis on messages ios" - working

"how many emojis on ipados" - working

"how many emojis in ios" - error

"how many emojis inside ios" - error

"ios number of emojis" - working

"how many emojis on i" - working

"how many emojis on ios has" - error

"how many emojis on ios has does" - error

"how many emojis on ios has does how has does how has does how" - error

I'd hazard that a specific web page appearing in the results is probably causing this error - I would be very curious to find out which page this is.

Edit: Yep, a specific .com site seems to be causing it:

"how many emojis on ios site:com" - error

"how many emojis on ios site:aero" - works

> Yep, a specific .com site seems to be causing it:

If you add a start date filter (even since 2000 years ago) it will work.

Pre 1968 doesn't work
org - error

io, net, ru - ok

(comment deleted)
pretty clever narrowing down of the problem, well done
It seems that this site (emojipedia.org) broke the Google.

"how many emojis on ios -inurl:emojipedia.org"

trying to exclude other sites does not work:

how many emojis on ios -inurl:cnet.com

how many emojis on ios -inurl:wikipedia.org

searching for "emojipedia.com" breaks it

https://www.google.com/search?q=emojipedia.com

I can't reproduce this one, i.e. this url works fine for me.

At the same time I can reproduce the results from the grandparent comment.

I can reproduce that. Interesting, because the .com site redirects to the .org, and saearching for the org site on Google does not cause the error.
Yes, however searching for ““emojipedia.com””(quoted exact search) does work.
how many emojis on ios inurl:emojipedia.org

is slow, but works, while

how many emojis on ios

still does not work.

Maybe it's multiple sites that would individually just cause a slowdown but together push it over the edge?

After all (at least for me) it doesn't crash immediately but it more seems to throw an error after a timeout because it keeps loading without result.

I think the .com version breaks it.
This site is on multiple domains, so you can try excluding emojipedia entirely (org,com). Works perfectly:

how many emojis on ios -emojipedia

I wonder what's so special about that site that is able to break/timeout Google's index
Maybe they broke the back button so hard that even the google bot can't get out?
Probably a Unicode character whose bytes are misinterpreted by some weakly typed C++ or Java code.
My guess is that it will be a problem with handling Unicode in some way. There will be a page on emojipedia with some Unicode emojis in the title or description that Google can’t handle while trying to extract the text to display a result.
I'm curious if we can weaponize this to take down google. lol.

Not that we should... but curiosity does lead to some interesting finds sometimes.

It's the opposite. You can weaponize it to kill other sites SEO by spamming the offending emoji in them.
It's both. A broken Google result page is a lost opportunity for ad revenue for Google.
> Not that we should

relax with the disclaimers, I think we're all on the same side.

> curious if we can weaponize this to take down google. lol.

I was thinking more of accessing the Google search binary or source code.

"How many emoji on ios" works.

Wonder why "emojis" itself throws an error? I would expect the query understanding model to have the same result for the singular and plural forms

Seems to not crash for me - just takes several seconds to load the results.
This looks like a timeout.

- same request with "s" removed from "emojis": works, but in 5.03 seconds (!)

- "how many emoji symbols on ios": 1.37 seconds

Other modifications further decrease the request time.

(comment deleted)
It blows my mind that after a decade or so of dominance, they don't have a fast 'fail and remove from results' implemented.
Or they do have handling for errors and the extra code did not handle all types of failure modes and added new failure modes on its own.
(comment deleted)
Of course they do, every large search implementation has done that if a node times out, since the 90's.

Something unusual about this query evidently triggered a bug in the somewhere. We will probably never know the specifics.

That's a great way to remove work for engineers, bit it's not a solution
how many emojis in iOS works instantly, 100ms on the search request
If you add a start date filter (even since 2000 years ago) it will work.