ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

GPGME::Error Bad file descriptor using GPGME::Key.find #115

Open joshuamcginnis opened 6 years ago

joshuamcginnis commented 6 years ago

I'm using ruby 2.5.0 and gpgme 2.0.16 with rails and sidekiq. I'm spinning up about 40 GPG decryption jobs, processing about 10 jobs (using threads) * 3 processes concurrently.

Searching for a private key randomly raises GPGME::Error Bad file descriptor randomly in my jobs:

return unless GPGME::Key.find(:secret, PRIVATE_KEY_SHA).empty?

Two questions: When would using GPGME::Key.find trigger this error? Is this gem thread-safe?

Any insight would be much appreciated.