Skip to content

Maintenance updates and API version enhancements and enhanced error handling for the Blob and Queue services#2675

Open
jainakanksha-msft wants to merge 14 commits into
mainfrom
akkuVulFixes
Open

Maintenance updates and API version enhancements and enhanced error handling for the Blob and Queue services#2675
jainakanksha-msft wants to merge 14 commits into
mainfrom
akkuVulFixes

Conversation

@jainakanksha-msft

@jainakanksha-msft jainakanksha-msft commented Jul 20, 2026

Copy link
Copy Markdown
Member

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:

  • Updated several dependencies (axios, morgan, esbuild) to address security vulnerabilities and maintenance needs. [1] [2]
  • Bumped the default API version for Blob, Queue, and Table services to 2026-06-06, and added support for versions 2026-04-06 and 2026-02-06.

Blob Service Improvements:

  • Fixed startup failures with legacy persisted data by adding backward-compatible restore logic for persisted contentMD5 formats.
  • Improved error handling in BlobServer to wait for the server to reach the Running state before shutting down in response to GC errors, preventing premature shutdowns during startup. Enhanced logging for GC errors and shutdown diagnostics. [1] [2]
  • Refactored and clarified code in LokiBlobMetadataStore for 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:

  • Fixed a startup race condition by avoiding GC-triggered close() calls while the server status is Starting.

General Maintenance:

  • Added detailed changelog entries summarizing all major updates and fixes. [1] [2]

These changes improve the overall reliability, maintainability, and security of the project.

Copilot AI review requested due to automatic review settings July 20, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings July 20, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Comment thread ChangeLog.md Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 14:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings July 21, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/table/utils/constants.ts Outdated
Copilot AI review requested due to automatic review settings July 21, 2026 11:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@jainakanksha-msft jainakanksha-msft changed the title Updated npm package fixes Maintenance updates and API version enhancements Jul 23, 2026
@jainakanksha-msft jainakanksha-msft linked an issue Jul 23, 2026 that may be closed by this pull request
Copilot AI review requested due to automatic review settings July 23, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.

Comment thread src/blob/BlobServer.ts Outdated
Comment thread src/queue/QueueServer.ts Outdated
Comment thread src/blob/persistence/LokiBlobMetadataStore.ts
Copilot AI review requested due to automatic review settings July 23, 2026 09:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_MESSAGE is logged unconditionally, even when the server never transitions to Running or when close() 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_MESSAGE is logged unconditionally, even when the server never transitions to Running or when close() 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);

@jainakanksha-msft jainakanksha-msft linked an issue Jul 23, 2026 that may be closed by this pull request
Copilot AI review requested due to automatic review settings July 23, 2026 10:54
@jainakanksha-msft jainakanksha-msft changed the title Maintenance updates and API version enhancements Maintenance updates and API version enhancements and enhanced error handling for the Blob and Queue services Jul 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 fix to update dependencies.
- Applied npm audit fix to updates across multiple dependencies to address security vulnerabilities and maintenance updates.

Comment thread tests/blob/upgradeRegression.test.ts
Copilot AI review requested due to automatic review settings July 23, 2026 11:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ServerStatus value, 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.status as a number. Use ServerStatus[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 ServerStatus value. Prefer ServerStatus[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}`
            );

Comment thread src/blob/BlobServer.ts Outdated
Comment thread src/queue/QueueServer.ts Outdated
Comment thread src/azurite.ts
Comment thread tests/blob/upgradeRegression.test.ts Outdated
Comment thread tests/blob/unit/gcErrorHandler.unit.test.ts Outdated
Comment thread tests/table/auth/sas.test.ts
Copilot AI review requested due to automatic review settings July 23, 2026 12:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Comment thread src/common/GCCriticalErrorCloseHelper.ts
Comment thread tests/blob/startupErrorRecovery.test.ts Outdated
Comment thread tests/queue/startupErrorRecovery.test.ts Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 19 changed files in this pull request and generated 4 comments.

Comment thread tests/blob/startupErrorRecovery.test.ts
Comment thread tests/queue/startupErrorRecovery.test.ts
Comment thread tests/table/auth/sas.test.ts
Comment thread tests/blob/upgradeRegression.test.ts Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 13:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 19 changed files in this pull request and generated 3 comments.

Comment thread src/azurite.ts
Comment on lines +59 to +62
const errorMsg = err instanceof Error ? err.message : String(err);
console.error(
`Shutdown close failed in status ${ServerStatus[statusBeforeClose]}: ${errorMsg}`
);
Comment thread src/blob/BlobServer.ts
Comment on lines +146 to 151
handleGCCriticalErrorClose({
serviceName: "Blob",
getStatus: () => this.status,
close: () => this.close(),
logger
});
Comment thread src/queue/QueueServer.ts
Comment on lines +145 to 150
handleGCCriticalErrorClose({
serviceName: "Queue",
getStatus: () => this.status,
close: () => this.close(),
logger
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support service version 2026-06-06 3.36.0 Error on Container Start

2 participants