Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash while checkpointing due to fs.* errors #452

Open
cpcallen opened this issue Mar 2, 2021 · 0 comments
Open

Crash while checkpointing due to fs.* errors #452

cpcallen opened this issue Mar 2, 2021 · 0 comments
Labels
bug server Things related to the codecity server proper
Milestone

Comments

@cpcallen
Copy link
Collaborator

cpcallen commented Mar 2, 2021

If a .city file is removed while the server is preparing to checkpoint, it will cause the server to crash before the checkpoint is performed:

Checkpoint 2021-03-02T11.48.19.274Z.city complete.
Checkpointing...
internal/fs/utils.js:220
    throw err;
    ^

Error: ENOENT: no such file or directory, stat '2021-03-02T10.11.40.306Z.city'
    at Object.statSync (fs.js:915:3)
    at Object.CodeCity.fileSize (/Users/cpcallen/src/CodeCity/server/codecity:286:13)
    at Object.CodeCity.deleteCheckpointsIfNeeded (/Users/cpcallen/src/CodeCity/server/codecity:207:16)
    at Timeout.CodeCity.checkpoint [as _onTimeout] (/Users/cpcallen/src/CodeCity/server/codecity:296:12)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '2021-03-02T10.11.40.306Z.city'
}

The checkpointing code should have some try {…} catch {…}es added so that it will not have a fit if a file disappears out from it or there are otherwise errors (e.g. in writing).

Just not checkpointing at all is preferable to crashing.

@cpcallen cpcallen added bug server Things related to the codecity server proper labels Mar 2, 2021
@cpcallen cpcallen added this to the Launch: Alpha milestone Mar 2, 2021
@cpcallen cpcallen changed the title fs errors crash checkpointing Crash while checkpointing due to fs.* errors Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug server Things related to the codecity server proper
Projects
None yet
Development

No branches or pull requests

1 participant