Skip to content

Commit

Permalink
Fix the issue of full cpus/ram when handling corrupted org (#2886)
Browse files Browse the repository at this point in the history
When the disk was full, some strange things happened.

Some files are created but the files are empty.

In my case, my disk was full, so an organization's .json.db file was
created with zero length content, causing a loop of the startOrg call.

This commit will fix that problem by checking if the organization's
.json.db file is corrupted.
  • Loading branch information
vinhjaxt authored Aug 13, 2023
1 parent f8d2635 commit 47a85ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions services/orgs/orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ func (self *OrgManager) Scan() error {

delete(existing, org_id)

if org_record.Id == "" || org_record.Nonce == "" {
logger := logging.GetLogger(self.config_obj, &logging.FrontendComponent)
logger.Info("<yellow>Org is corrupted %v</>", org_id)
continue
}

_, err = self.GetOrgConfig(org_id)
if err != nil {
err = self.startOrg(org_record)
Expand Down

0 comments on commit 47a85ab

Please sign in to comment.