Skip to content

Conversation

@seqizz
Copy link

@seqizz seqizz commented Jan 13, 2026

Summary

On parallel runs on a single puppetserver (debian bookworm, v: 7.9.5-2+deb12u1) with 8 workers, we randomly get Error while evaluating a Function Call, system does not support enhanced salts even though it works most of the time.

Additional Context

Apparently this was a race condition, so this is an attempt to add a mutex for not colliding calculations.

Disclaimer: Since I am not a fluent ruby/java person and I realize this is a security-sensitive file to touch; I'd love to see a thorough review from someone more familiar with it. This is just an attempt to share a solution which worked in our environment.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@CLAassistant
Copy link

CLAassistant commented Jan 13, 2026

CLA assistant check
All committers have signed the CLA.

Native crypt(3) uses a static buffer and is not thread-safe. On puppetserver,
multiple JRuby workers share the same JVM, causing intermittent failures when
concurrent pw_hash calls corrupt each other's crypt results. This fix uses
synchronized block on the Crypt class for JVM-wide locking on JRuby, and a
Ruby Mutex for MRI.
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