Skip to content

Commit

Permalink
adjust retry counts
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Mar 17, 2024
1 parent dad2c7a commit f131325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions server/vm/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export abstract class VMManager {
// Do a minimum # of retries to give reboot time
return [vmid, retryCount, false].join(',');
}
if (retryCount % 100 === 0) {
if (retryCount % 150 === 0) {
console.log(
'[CHECKSTAGING] %s: %s poweron, attach to network',
this.getPoolName(),
Expand All @@ -434,15 +434,15 @@ export abstract class VMManager {
this.powerOn(vmid);
//this.attachToNetwork(vmid);
}
if (retryCount % 150 === 0) {
if (retryCount % 180 === 0) {
console.log('[CHECKSTAGING]', this.getPoolName(), 'giving up:', vmid);
redisCount('vBrowserStagingFails');
await redis?.lpush('vBrowserStageFails', vmid);
await redis?.ltrim('vBrowserStageFails', 0, 24);
await this.resetVM(vmid);
// await this.terminateVMWrapper(vmid);
}
if (retryCount >= 150) {
if (retryCount >= 180) {
throw new Error('too many attempts on vm ' + vmid);
}
// Fetch data on first attempt
Expand Down
3 changes: 2 additions & 1 deletion server/vmWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ app.get('/isFreePoolFull', async (req, res) => {
const freePools = Object.values(vmManagers).filter((mgr) => {
return (
mgr?.getIsLarge() === false &&
mgr?.getRegion() === config.DEFAULT_VM_REGION
mgr?.getRegion() === config.DEFAULT_VM_REGION &&
mgr?.getLimitSize() > 0
);
});
const fullResult = await Promise.all<Boolean>(
Expand Down

0 comments on commit f131325

Please sign in to comment.