puppetlabs / puppet-editor-services

Puppet Language Server for editors
Apache License 2.0
45 stars 21 forks source link

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

Closed jordanbreen28 closed 2 months ago

jordanbreen28 commented 2 months ago

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.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

codecov[bot] commented 2 months ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.