Maintenance updates and API version enhancements and enhanced error handling for the Blob and Queue services#2675
Maintenance updates and API version enhancements and enhanced error handling for the Blob and Queue services#2675jainakanksha-msft wants to merge 14 commits into
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
ChangeLog.md:9
- Changelog entry is grammatically awkward (“Applied npm audit fix to updates…”). Consider rephrasing so the sentence reads clearly.
- Applied npm audit fix to updates across multiple dependencies to address security vulnerabilities and maintenance updates.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
ChangeLog.md:9
- Wording/grammar: “Applied npm audit fix to updates…” is awkward and reads like a partial sentence. Consider rephrasing to make the changelog entry clearer.
- Applied npm audit fix to updates across multiple dependencies to address security vulnerabilities and maintenance updates.
Fixes race condition where GC error during startup would attempt to close server while still in 'Starting' state, resulting in 'Cannot close server in status Starting' error. Changes: - Modified BlobServer and QueueServer error handlers to wait for server to reach 'Running' state before attempting close - Added timeout logic (up to 5 seconds) to wait for server startup completion - Gracefully handles case where server cannot transition to Running state - Allows Azurite to recover when encountering errors processing legacy persisted data from previous versions Fixes: #2672
- Added 4 test files with 10 total test cases covering: * Unit tests for GC error handler state machine (3 tests) * Blob server startup error recovery scenarios (3 tests) * Upgrade regression tests (3.35.0 to 3.36.0+) (2 tests) * Queue server startup error recovery scenarios (2 tests) - Tests validate: * Fresh start scenarios without persisted data * Graceful error handling during GC initialization in Starting state * Concurrent startup operations * Data persistence across upgrade scenarios * Multi-container and multi-blob scenarios * Recovery from timeout conditions - All 777 tests passing (including 10 new tests) - No regressions in existing tests - Full TypeScript compilation clean
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 18 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
src/blob/BlobServer.ts:187
AFTER_CLOSE_MESSAGEis logged unconditionally, even when the server never transitions to Running or whenclose()is skipped/throws. This can produce a misleading "successfully closed" message right after logging that the server will continue operating.
console.log(AFTER_CLOSE_MESSAGE);
logger.info(AFTER_CLOSE_MESSAGE);
src/queue/QueueServer.ts:188
AFTER_CLOSE_MESSAGEis logged unconditionally, even when the server never transitions to Running or whenclose()is skipped/throws. This can emit a misleading "successfully closed" message right after logging that the server will continue operating.
console.log(AFTER_CLOSE_MESSAGE);
logger.info(AFTER_CLOSE_MESSAGE);
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
ChangeLog.md:9
- Changelog entry is grammatically unclear: "Applied npm audit fix to updates..." reads like an extra noun. Consider rephrasing to clearly describe applying
npm audit fixto update dependencies.
- Applied npm audit fix to updates across multiple dependencies to address security vulnerabilities and maintenance updates.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 18 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (4)
src/blob/BlobServer.ts:174
- This warning prints the numeric
ServerStatusvalue, which reduces log usefulness. Prefer the enum name (ServerStatus[this.status]).
logger.warn(
`Blob server status is ${this.status} (expected Running). ` +
`Server state may be inconsistent. Check logs for root cause.`
);
src/blob/BlobServer.ts:182
- The error log prints
this.statusas a number. UseServerStatus[this.status]so shutdown diagnostics are readable.
logger.error(
`Blob server error during GC error handling: ${errorMsg}. ` +
`Server status: ${this.status}`
);
src/queue/QueueServer.ts:175
- This warning prints the numeric
ServerStatusvalue. PreferServerStatus[this.status]for readable logs.
logger.warn(
`Queue server status is ${this.status} (expected Running). ` +
`Server state may be inconsistent. Check logs for root cause.`
);
src/queue/QueueServer.ts:183
- This error message logs the numeric server status; use the enum name via
ServerStatus[this.status]for clearer shutdown diagnostics.
logger.error(
`Queue server error during GC error handling: ${errorMsg}. ` +
`Server status: ${this.status}`
);
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 19 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (3)
tests/blob/startupErrorRecovery.test.ts:97
- This test uses a fixed port (11001) which is heavily reused across the queue/blob test suites. Since Promise.race() doesn't cancel server.start(), late startup after the timeout can cause flaky port collisions. Prefer port 0 (ephemeral) here.
11001,
tests/blob/startupErrorRecovery.test.ts:156
- This test uses a fixed port (11002) which is also used by other test suites. If server.start() continues after a Promise.race() timeout, it can start listening later and collide with other tests. Prefer port 0 (ephemeral) here.
11002,
tests/queue/startupErrorRecovery.test.ts:89
- Even though 11003 is less commonly used, using a fixed port here still risks collisions if tests are ever run concurrently or if a timed-out server.start() continues in the background. Prefer port 0 (ephemeral) for stability.
11003,
| const errorMsg = err instanceof Error ? err.message : String(err); | ||
| console.error( | ||
| `Shutdown close failed in status ${ServerStatus[statusBeforeClose]}: ${errorMsg}` | ||
| ); |
| handleGCCriticalErrorClose({ | ||
| serviceName: "Blob", | ||
| getStatus: () => this.status, | ||
| close: () => this.close(), | ||
| logger | ||
| }); |
| handleGCCriticalErrorClose({ | ||
| serviceName: "Queue", | ||
| getStatus: () => this.status, | ||
| close: () => this.close(), | ||
| logger | ||
| }); |
This pull request addresses security, stability, and compatibility improvements across the codebase, with a focus on dependency updates, API version support, and enhanced error handling for the Blob and Queue services. It also includes several code style and maintainability improvements.
Dependency and API Updates:
axios,morgan,esbuild) to address security vulnerabilities and maintenance needs. [1] [2]2026-06-06, and added support for versions2026-04-06and2026-02-06.Blob Service Improvements:
contentMD5formats.BlobServerto wait for the server to reach theRunningstate before shutting down in response to GC errors, preventing premature shutdowns during startup. Enhanced logging for GC errors and shutdown diagnostics. [1] [2]LokiBlobMetadataStorefor better readability and maintainability, including formatting and parameter handling. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Queue Service Improvements:
close()calls while the server status isStarting.General Maintenance:
These changes improve the overall reliability, maintainability, and security of the project.