Skip to content

Commit cacb61e

Browse files
committed
restore: metrics_write at shutdown
1 parent f0dc71a commit cacb61e

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/discof/restore/fd_snapdc_tile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ handle_control_frag( fd_snapdc_tile_t * ctx,
147147
case FD_SNAPSHOT_MSG_CTRL_SHUTDOWN:
148148
FD_TEST( ctx->state==FD_SNAPDC_STATE_DONE );
149149
ctx->state = FD_SNAPDC_STATE_SHUTDOWN;
150+
metrics_write( ctx ); /* ensures that shutdown state is written to metrics workspace before the tile actually shuts down */
150151
break;
151152
default:
152153
FD_LOG_ERR(( "unexpected control sig %lu", sig ));

src/discof/restore/fd_snapin_tile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ handle_control_frag( fd_snapin_tile_t * ctx,
250250
break;
251251
case FD_SNAPSHOT_MSG_CTRL_SHUTDOWN:
252252
ctx->state = FD_SNAPIN_STATE_SHUTDOWN;
253+
metrics_write( ctx ); /* ensures that shutdown state is written to metrics workspace before the tile actually shuts down */
253254
break;
254255
default:
255256
FD_LOG_ERR(( "unexpected control sig %lu", sig ));

src/discof/restore/fd_snaprd_tile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ after_credit( fd_snaprd_tile_t * ctx,
584584

585585
rename_snapshots( ctx );
586586
ctx->state = FD_SNAPRD_STATE_SHUTDOWN;
587+
metrics_write( ctx ); /* ensures that shutdown state is written to metrics workspace before the tile actually shuts down */
587588
fd_stem_publish( stem, 0UL, FD_SNAPSHOT_MSG_CTRL_SHUTDOWN, 0UL, 0UL, 0UL, 0UL, 0UL );
588589
break;
589590
case FD_SNAPRD_STATE_FLUSHING_FULL_FILE:
@@ -592,6 +593,7 @@ after_credit( fd_snaprd_tile_t * ctx,
592593

593594
if( FD_LIKELY( !ctx->config.incremental_snapshot_fetch ) ) {
594595
ctx->state = FD_SNAPRD_STATE_SHUTDOWN;
596+
metrics_write( ctx ); /* ensures that shutdown state is written to metrics workspace before the tile actually shuts down */
595597
fd_stem_publish( stem, 0UL, FD_SNAPSHOT_MSG_CTRL_SHUTDOWN, 0UL, 0UL, 0UL, 0UL, 0UL );
596598
break;
597599
}
@@ -616,6 +618,7 @@ after_credit( fd_snaprd_tile_t * ctx,
616618
if( FD_LIKELY( !ctx->config.incremental_snapshot_fetch ) ) {
617619
rename_snapshots( ctx );
618620
ctx->state = FD_SNAPRD_STATE_SHUTDOWN;
621+
metrics_write( ctx ); /* ensures that shutdown state is written to metrics workspace before the tile actually shuts down */
619622
fd_stem_publish( stem, 0UL, FD_SNAPSHOT_MSG_CTRL_SHUTDOWN, 0UL, 0UL, 0UL, 0UL, 0UL );
620623
break;
621624
}

0 commit comments

Comments
 (0)