The Talmud records a teaching that it is considered a good sign when a righteous person dies close in time to their loved one, and discusses sudden, peaceful death as a sign of divine favor.
תַּנְיָא נָמֵי הָכִי: תְּשַׁע מֵאוֹת וּשְׁלֹשָׁה מִינֵי מִיתָה נִבְרְאוּ בָּעוֹלָם, שֶׁנֶּאֱמַר: ״לַמָּוֶת תּוֹצָאוֹת״, ״תּוֹצָאוֹת״ בְּגִימַטְרִיָּא הָכִי הָווּ. קָשָׁה שֶׁבְּכֻלָּן — אַסְכָּרָא, נִיחָא שֶׁבְּכֻלָּן — נְשִׁיקָה. אַסְכָּרָא דָּמְיָא כְּחִיזְרָא בִּגְבָבָא דְעַמְרָא דִּלְאַחוֹרֵי נַשְׁרָא, וְאִיכָּא דְאָמְרִי כְּפִיטּוּרֵי בְּפִי וֶשֶׁט, נְשִׁיקָה דָּמְיָא כְּמִשְׁחַל בִּנִיתָא מֵחֲלָבָא. רַבִּי יוֹחָנָן אָמַר: ״לְעֵת מְצֹא״ — זוֹ קְבוּרָה. אָמַר רַבִּי חֲנִינָא, מַאי קְרָא ״הַשְּׂמֵחִים אֱלֵי גִיל יָשִׂישׂוּ כִּי יִמְצְאוּ קָבֶר״. אָמַר רַבָּה בַּר רַב שֵׁילָא, הַיְינוּ דְּאָמְרִי אִינָשֵׁי: לִיבְעֵי אִינָשׁ רַחֲמֵי אֲפִילּוּ עַד זִיבּוּלָא בָּתְרָיְיתָא שְׁלָמָא.
It was also taught in a baraita: Nine hundred and three types of death were created in the world, as it is stated: “Issues [totzaot] of death,” and that, 903, is the numerical value [gimatriya] of totzaot. The Gemara explains that the most difficult of all these types of death is croup [askara], while the easiest is the kiss of death. Croup is like a thorn entangled in a wool fleece, which, when pulled out backwards, tears the wool. Some say that croup is like ropes at the entrance to the esophagus, which would be nearly impossible to insert and excruciating to remove. The kiss of death is like drawing a hair from milk. One should pray that he does not die a painful death. Rabbi Yoḥanan said: The time of finding refers to a respectful burial, for which one should pray. Supporting Rabbi Yoḥanan’s interpretation, Rabbi Ḥanina said: What is the verse that teaches that the time of finding refers to burial? “Who rejoice in exultation and are glad when they can find a grave” (Job 3:22), as there are situations in which one is relieved when his body finds a grave in which to rest. Rabba bar Rav Sheila said, that is the meaning of the folk saying: A person should even pray for mercy until the final shovelful of dirt is thrown upon his grave.