-
Notifications
You must be signed in to change notification settings - Fork 143
Fix memory leak: clean up listeners on repeated useAzureMonitor calls #1493
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
Merged
JacksonWeber
merged 2 commits into
microsoft:main
from
JacksonWeber:jacksonweber/fix-memory-leak-pg
Mar 24, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,56 +1,26 @@ | ||
| name: Node.js CI (Windows ARM64) | ||
|
|
||
| # NOTE: GitHub does not offer public Windows ARM64 runners. | ||
| # The previous version of this workflow used QEMU to emulate ARM64 Linux in | ||
| # Docker, which was neither testing Windows nor reliably passing due to | ||
| # emulation flakiness. Native ARM64 testing is now covered by the | ||
| # node.js-linux-arm64.yml workflow using ubuntu-24.04-arm runners. | ||
| # | ||
| # This workflow will be enabled once GitHub provides public Windows ARM64 | ||
| # runners (or a self-hosted runner is configured). | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| build: | ||
| # Use the Linux runner instead as it has better Docker support | ||
| placeholder: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| # Using the same Node versions as the main workflow but without the .x suffix for Docker images | ||
| node-version: [18, 20, 22, 24] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v2 | ||
| with: | ||
| platforms: arm64 | ||
| # Generate certificates using Linux openssl command | ||
| - name: Generate SSL Certificate | ||
| run: | | ||
| # Create certificates directory | ||
| mkdir -p ./test/certs | ||
|
|
||
| # Generate SSL certificates | ||
| openssl req -x509 -nodes -newkey rsa:2048 -keyout ./test/certs/server-key.pem -out ./test/certs/server-cert.pem -days 1 -subj "/C=CL/ST=RM/L=OpenTelemetryTest/O=Root/OU=Test/CN=ca" | ||
|
|
||
| # Set permissions | ||
| chmod -R 777 . | ||
|
|
||
| - name: Run Node.js ${{ matrix.node-version }} tests in ARM64 Docker container | ||
| run: | | ||
| # Run the tests in an ARM64 container | ||
| docker run --rm -v ${{ github.workspace }}:/app -w /app --platform linux/arm64 node:${{ matrix.node-version }}-alpine sh -c ' | ||
| echo "Running tests for Node.js ${{ matrix.node-version }} on ARM64 emulation (Windows-targeted tests)" | ||
|
|
||
| # Install build dependencies for native modules | ||
| apk add --no-cache python3 make g++ | ||
|
|
||
| # Clean out directory only (preserve node_modules for fresh install) | ||
| rm -rf ./out | ||
|
|
||
| # Install dependencies and run tests | ||
| npm i | ||
| npm run build --if-present | ||
| npm run lint | ||
| npm test | ||
| ' | ||
| - name: Windows ARM64 testing not yet available | ||
| run: | | ||
| echo "Skipped: GitHub does not offer public Windows ARM64 runners." | ||
| echo "ARM64 testing is covered by the Linux ARM64 workflow (ubuntu-24.04-arm)." | ||
| echo "See: https://github.com/actions/runner-images#available-images" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Node.js CI (Windows) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: windows-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x, 22.x, 24.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Generate SSL Certificate | ||
| shell: pwsh | ||
| run: | | ||
| $certsDir = ".\test\certs" | ||
| if (-not (Test-Path $certsDir)) { | ||
| New-Item -ItemType Directory -Path $certsDir | ||
| } | ||
|
|
||
| $cert = New-SelfSignedCertificate -Subject "CN=ca,OU=Test,O=Root,L=OpenTelemetryTest,ST=RM,C=CL" -NotAfter (Get-Date).AddDays(1) | ||
|
|
||
| # Export certificate to PEM format | ||
| $certBytes = $cert.Export("Cert") | ||
| $pemCert = "-----BEGIN CERTIFICATE-----`r`n" + [Convert]::ToBase64String($certBytes, [System.Base64FormattingOptions]::InsertLineBreaks) + "`r`n-----END CERTIFICATE-----" | ||
| Set-Content -Path "$certsDir\server-cert.pem" -Value $pemCert | ||
|
|
||
| # Export private key placeholder | ||
| $randomBytes = New-Object byte[] 32 | ||
| [Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($randomBytes) | ||
| $randomKeyContent = [Convert]::ToBase64String($randomBytes) | ||
| Set-Content -Path "$certsDir\server-key.pem" -Value "-----BEGIN PRIVATE KEY-----`r`n$randomKeyContent`r`n-----END PRIVATE KEY-----" | ||
|
|
||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
|
|
||
| - run: npm run clean | ||
| - name: Install dependencies | ||
| run: | | ||
| npm i | ||
| if (!(Test-Path -Path node_modules/diagnostic-channel-publishers)) { | ||
| npm i diagnostic-channel-publishers --no-save | ||
| } | ||
| - run: npm run build --if-present | ||
| - run: npm run lint | ||
| - name: Run tests with mocks | ||
| run: npm run test:mocked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.