Skip to content

fix(js): possible race condition in the wrappers#539

Merged
yoheimuta merged 1 commit into
yoheimuta:masterfrom
AlexCannonball:fix/js-wrappers-possible-race
Mar 8, 2026
Merged

fix(js): possible race condition in the wrappers#539
yoheimuta merged 1 commit into
yoheimuta:masterfrom
AlexCannonball:fix/js-wrappers-possible-race

Conversation

@AlexCannonball

@AlexCannonball AlexCannonball commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Hello,

I've checked the recent test failures from #537 and #530:

Test install on ubuntu-latest / Node lts/*
  npm install --omit=dev --no-audit --no-fund
  # Verify local binaries via npx (using --no-install to force local check)
  npx --no-install protolint version
  npx --no-install protoc-gen-protolint version
  shell: /usr/bin/bash -e {0}

> protolint@0.47.4 postinstall
> node postinstall.js

protolint-install: Fetching protolint executable from https://github.com/yoheimuta/protolint/releases/download/v0.47.4/protolint_0.47.4_linux_amd64.tar.gz
protolint-install: Protolint installed successfully.

added 2 packages in 2s
protolint version 0.47.4(2f86d18)
Error: Process completed with exit code 1.
Test install on ubuntu-latest / Node 20
  npm install --omit=dev --no-audit --no-fund
  # Verify local binaries via npx (using --no-install to force local check)
  npx --no-install protolint version
  npx --no-install protoc-gen-protolint version
  shell: /usr/bin/bash -e {0}

> protolint@0.47.4 postinstall
> node postinstall.js

protolint-install: Fetching protolint executable from https://github.com/yoheimuta/protolint/releases/download/v0.47.4/protolint_0.47.4_linux_amd64.tar.gz
protolint-install: Protolint installed successfully.

added 2 packages in 2s
protolint version 0.47.4(2f86d18)
Error: Process completed with exit code 1.
Test install on windows-latest / Node 20
  npm install --omit=dev --no-audit --no-fund
  # Verify local binaries via npx (using --no-install to force local check)
  npx --no-install protolint version
  npx --no-install protoc-gen-protolint version
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"

> protolint@0.47.4 postinstall
> node postinstall.js

protolint-install: Fetching protolint executable from https://github.com/yoheimuta/protolint/releases/download/v0.47.4/protolint_0.47.4_windows_amd64.tar.gz
protolint-install: Protolint installed successfully.

added 2 packages in 3s
protolint version 0.47.4(2f86d18)
Error: Process completed with exit code 1.

Except failing protoc-gen-protolint version in local install case, it doesn't seem to have a consistent pattern so far.

Gemini tells that adding a top-level await may fix a possible race condition when the Node main process cleanup happens before close event listener completes its job.

This sounds reasonable and the top level await shouldn't make it worse.

Assuming that a top level await will make sure that 'close' event is
handled properly.

@yoheimuta yoheimuta left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for the fix.

@yoheimuta yoheimuta merged commit 0960341 into yoheimuta:master Mar 8, 2026
14 checks passed
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.

2 participants