File tree 1 file changed +16
-4
lines changed
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -2155,10 +2155,17 @@ void ActorCache::ensureFlushScheduled(const WriteOptions& options) {
2155
2155
2156
2156
if (!flushScheduled) {
2157
2157
flushScheduled = true ;
2158
- auto flushPromise = lastFlush.addBranch ().attach (kj::defer ([this ]() {
2159
- flushScheduled = false ;
2160
- flushScheduledWithOutputGate = false ;
2161
- })).then ([this ]() {
2158
+ auto flushPromise = lastFlush.addBranch ().attach (
2159
+ util::DurationExceededLogger (
2160
+ clock ,
2161
+ 5 * kj::SECONDS,
2162
+ kj::str (" waiting on previous flushes took longer than expected" , flushesEnqueued)
2163
+ ),
2164
+ kj::defer ([this ]() {
2165
+ flushScheduled = false ;
2166
+ flushScheduledWithOutputGate = false ;
2167
+ }))
2168
+ .then ([this ]() {
2162
2169
++flushesEnqueued;
2163
2170
return kj::evalNow ([this ](){
2164
2171
// `flushImpl()` can throw, so we need to wrap it in `evalNow()` to observe all pathways.
@@ -2492,6 +2499,11 @@ kj::Promise<void> ActorCache::startFlushTransaction() {
2492
2499
}
2493
2500
2494
2501
kj::Promise<void > ActorCache::flushImpl (uint retryCount) {
2502
+ auto durationAlert = util::DurationExceededLogger (
2503
+ clock ,
2504
+ 5 * kj::SECONDS,
2505
+ " flushImpl took longer than expected"
2506
+ );
2495
2507
KJ_IF_SOME (e, maybeTerminalException) {
2496
2508
// If we have a terminal exception, throw here to break the output gate and prevent any calls
2497
2509
// to storage. This does not use `requireNotTerminal()` so that we don't recursively schedule
You can’t perform that action at this time.
0 commit comments