@@ -83,7 +83,7 @@ export class CrashMonitoring {
8383 const state = await crashMonitoringStateFactory ( )
8484 return ( this . #instance ??= new CrashMonitoring (
8585 state ,
86- DevSettings . instance . get ( 'crashCheckInterval' , 1000 * 60 * 3 ) ,
86+ DevSettings . instance . get ( 'crashCheckInterval' , 1000 * 60 * 10 ) , // check every 10 minutes
8787 isDevMode ,
8888 isAutomation ( ) ,
8989 devModeLogger
@@ -441,7 +441,7 @@ export class FileSystemState {
441441 )
442442 } )
443443 // retry a failed heartbeat to avoid incorrectly being reported as a crash
444- const _sendHeartbeatWithRetries = withRetries ( _sendHeartbeat , { maxRetries : 8 , delay : 100 , backoff : 2 } )
444+ const _sendHeartbeatWithRetries = withRetries ( _sendHeartbeat , { maxRetries : 7 , delay : 100 , backoff : 2 } )
445445 return _sendHeartbeatWithRetries
446446 }
447447
@@ -490,8 +490,14 @@ export class FileSystemState {
490490
491491 // Clean up the running extension file since it is no longer exists
492492 const dir = await this . runningExtsDir ( )
493- // Use force since another checker may have already removed this file before this is ran
494- await withFailCtx ( 'deleteStaleRunningFile' , ( ) => fs . delete ( path . join ( dir , extId ) ) )
493+ // Retry on failure since failing to delete this file will result in incorrectly reported crashes.
494+ // The common errors we were seeing were windows EPERM/EBUSY errors. There may be a relation
495+ // to this https://github.com/aws/aws-toolkit-vscode/pull/5335
496+ await withRetries ( ( ) => withFailCtx ( 'deleteStaleRunningFile' , ( ) => fs . delete ( path . join ( dir , extId ) ) ) , {
497+ maxRetries : 7 ,
498+ delay : 100 ,
499+ backoff : 2 ,
500+ } )
495501 }
496502
497503 // ------------------ State data ------------------
0 commit comments