[SERVER-48308] Avoid leaking exceptions in establishCursors cleanup callback Created: 19/May/20  Updated: 29/Oct/23  Resolved: 20/May/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 4.5.1, 4.4.0-rc4
Fix Version/s: 4.4.0-rc7, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Ian Boros Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
causes SERVER-49045 Remove invariant from establishCursor... Closed
Related
related to SERVER-46255 establishCursors/AsyncRequestsSender ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Query 2020-06-01
Participants:

 Description   

This uassert can trigger when the task executor is shutting down. The exception will bubble up, through this function marked noexcept. I would suggest getting rid of the uassert and instead log a message when args.status is not OK.

It would also be good to add some documentation about the rules of callbacks and exception throwing. My guess is that callback functions passed to TaskExecutor::scheduleWork() should never throw but I don't see any warnings about it in task_executor.h.



 Comments   
Comment by Githook User [ 21/May/20 ]

Author:

{'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-48308 Avoid leaking exceptions in establishCursors cleanup callback

(cherry picked from commit 617bcd621bd715aa52ed7a74c5dbd3d6689aa272)
Branch: v4.4
https://github.com/mongodb/mongo/commit/3fa59016d8747bb098e7960072a1efc05e50dcc9

Comment by Githook User [ 20/May/20 ]

Author:

{'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-48308 Avoid leaking exceptions in establishCursors cleanup callback
Branch: master
https://github.com/mongodb/mongo/commit/617bcd621bd715aa52ed7a74c5dbd3d6689aa272

Comment by Nicholas Zolnierz [ 20/May/20 ]

Thanks ian.boros, seems reasonable to change the uassert to a warning instead. My original thought of explicitly handling the shutdown error code isn't needed, since any non-OK status would indicate that the cleanup failed (or shouldn't proceed).

Comment by Ian Boros [ 19/May/20 ]

CC nicholas.zolnierz. I think we can fix this with suggestion in the ticket description but you'll probably know for sure.

Generated at Thu Feb 08 05:16:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.