[SERVER-45893] mongocryptd conflates lock and pid file Created: 30/Jan/20  Updated: 20/Mar/20  Resolved: 20/Mar/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Oleg Pudeyev (Inactive) Assignee: Mark Benvenuto
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-45894 mongocryptd pid file does not follow ... Closed
Sprint: Security 2020-02-24, Security 2020-03-09, Security 2020-03-23
Participants:

 Description   

When starting mongocryptd, I see the following message printed:

2020-01-30T18:09:35.739-0500 I  CONTROL  [initandlisten] Using lock file: /home/w/apps/ruby-driver/mongocryptd.pid

The lock file and the pid file in Unix are different concepts.

Lock file: https://dmorgan.info/posts/linux-lock-files/
Pid file: https://stackoverflow.com/questions/8296170/what-is-a-pid-file-and-what-does-it-contain

My reading of the source code (the createLockFile function) suggests the file should be named a "pid file" based on how it is used (I do not see any locking being done with it).

This function references the same path as a "pid file" in other messages.

Tested on 4.2 server built from source recently.



 Comments   
Comment by Mark Benvenuto [ 20/Mar/20 ]

createLockFile calls the class StorageEngineLockFile which eventually calls flock. On Windows, it calls CreateFile instead.

I am resolving this as a duplicate of SERVER-45894.

Generated at Thu Feb 08 05:09:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.