Skip to content

Windows: Fix infinite loop in tests when TMPDIR not defined. - #20027

Merged
KBaichoo merged 1 commit into
envoyproxy:mainfrom
rectified95:fix_deadlock
Feb 23, 2022
Merged

KBaichoo merged 1 commit into
envoyproxy:mainfrom
rectified95:fix_deadlock

Conversation

@rectified95

@rectified95 rectified95 commented Feb 18, 2022 •

Copy link
Copy Markdown
Contributor

Commit Message: Windows fix deadlock in unit tests when TMPDIR not defined.

Additional Description:
environment.cc::getTemporaryDirectory() calls makeTempDir() if the system variable TMPDIR is not defined.
This PR fixes commit #19713 which introduced an infinite loop for the above case. TestEnvironment::temporaryDirectory() ends up calling makeTempDir() and so on resulting in all tests hanging. (In the stacktrace, there are injected calls to the AtomicFileUpdater which perhaps leads to the deadlock with all threads getting suspended.)

Risk Level: Low
Testing: Manually edited environment variables, then ran any test.
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: Windows

@repokitteh-read-only

Copy link
Copy Markdown

Hi @rectified95, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #20027 was opened by rectified95.

see: more, trace.

@rectified95 rectified95 changed the title Windows: Fix infinite loop when TMPDIR not defined. Windows: Fix infinite loop in unit tests when TMPDIR not defined. Feb 18, 2022
@rectified95 rectified95 changed the title Windows: Fix infinite loop in unit tests when TMPDIR not defined. Windows: Fix infinite loop in tests when TMPDIR not defined. Feb 18, 2022
Comment thread test/test_common/environment.cc Resolved
@soulxu

soulxu commented Feb 18, 2022

Copy link
Copy Markdown
Member

thanks, this is much better than my one.

anrossi
anrossi previously approved these changes Feb 18, 2022

@anrossi anrossi 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.

looks good to me

Comment thread test/test_common/environment.cc Resolved
@rectified95

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 20027 in repo envoyproxy/envoy

@rectified95

Copy link
Copy Markdown
Contributor Author

Rebased before reviewer assigned to include recent CI fix in main. #20038

@soulxu soulxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, since it is already fixed the thing. just a comment to see if there is any improvement, but I could be wrong.

Thanks for your patience also!

@rectified95

Copy link
Copy Markdown
Contributor Author

@KBaichoo Can you merge the PR or tag someone with the right access to take a look?

@KBaichoo
KBaichoo enabled auto-merge (squash) February 23, 2022 16:44

@KBaichoo KBaichoo 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.

Thanks!

@KBaichoo
KBaichoo merged commit 3236abe into envoyproxy:main Feb 23, 2022
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.

4 participants