Commit a7b99ed
committed
fix(mongo): honour query timeout on count() and sum() aggregate paths
count() set maxTimeMS on $options but then reassigned $options from
getTransactionOptions() before the aggregate, discarding it; sum() never
set it at all. A total=true document list issues count(), so its
aggregation ran unbounded — a slow/large mongo read hung until the caller
gave up (surfacing downstream as a ~90s 503) instead of failing fast with
a Timeout. Set maxTimeMS on the options actually passed to aggregate() in
both paths. Regression: testCountTimeout.1 parent c279b24 commit a7b99ed
2 files changed
Lines changed: 56 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2718 | 2718 | | |
2719 | 2719 | | |
2720 | 2720 | | |
2721 | | - | |
2722 | | - | |
2723 | | - | |
2724 | | - | |
2725 | 2721 | | |
2726 | 2722 | | |
2727 | 2723 | | |
| |||
2745 | 2741 | | |
2746 | 2742 | | |
2747 | 2743 | | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
2748 | 2749 | | |
2749 | 2750 | | |
2750 | 2751 | | |
| |||
2848 | 2849 | | |
2849 | 2850 | | |
2850 | 2851 | | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
2851 | 2857 | | |
2852 | 2858 | | |
2853 | 2859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
89 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
90 | 136 | | |
91 | 137 | | |
92 | 138 | | |
| |||
0 commit comments