Skip to content
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

(bug) - Add synchronization to Dir.chdir in init_puppet_lint #374

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

jordanbreen28
Copy link
Contributor

@jordanbreen28 jordanbreen28 commented Apr 17, 2024

Summary

This PR wraps the Dir.chdir call in the validation_provider.rb file within a $PuppetParserMutex.synchronize block.

Before this change, the Dir.chdir method was called without synchronization, which could lead to conflicts if another chdir block was in progress.

This change prevents the error "(puppet/fixDiagnosticErrors) conflicting chdir during another chdir block" by ensuring that the Dir.chdir call is only executed by one thread at a time.

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@jordanbreen28 jordanbreen28 requested a review from a team as a code owner April 17, 2024 08:41
This commit wraps the `Dir.chdir` call in the `validation_provider.rb`
file within a `$PuppetParserMutex.synchronize` block.

Before this change, the `Dir.chdir` method was called without synchronization,
which could lead to conflicts if another `chdir` block was in progress.

This change prevents the error "(puppet/fixDiagnosticErrors) conflicting chdir
during another chdir block" by ensuring that the `Dir.chdir` call is only
executed by one thread at a time.
@jordanbreen28 jordanbreen28 force-pushed the bug-add_sync_to_puppet-lint-init branch from 6045797 to fb4bc1d Compare April 17, 2024 08:44
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 11.69%. Comparing base (2a7db14) to head (fb4bc1d).

Files Patch % Lines
...pet-languageserver/manifest/validation_provider.rb 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #374      +/-   ##
==========================================
- Coverage   11.69%   11.69%   -0.01%     
==========================================
  Files          92       92              
  Lines       11499    11501       +2     
==========================================
  Hits         1345     1345              
- Misses      10154    10156       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@LukasAud LukasAud left a comment

Choose a reason for hiding this comment

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

LGTM

@LukasAud LukasAud merged commit 1627acc into main Apr 17, 2024
11 of 13 checks passed
@LukasAud LukasAud deleted the bug-add_sync_to_puppet-lint-init branch April 17, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants