Project

General

Profile

Actions

Bug #7382

closed

When daemons run in parallel, pid files are generated with wrong PID in name

Added by Pavel Kácha over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Development - Core
Target version:
Start date:
05/28/2021
Due date:
% Done:

100%

Estimated time:
To be discussed:
No

Description

Seems PID in filename does not correspond with PID in file.

Actions #1

Updated by Rajmund Hruška almost 3 years ago

  • Assignee set to Rajmund Hruška
Actions #2

Updated by Jan Mach almost 3 years ago

  • Assignee changed from Rajmund Hruška to Jan Mach
Actions #3

Updated by Jan Mach almost 3 years ago

  • Status changed from New to Feedback
  • To be discussed changed from No to Yes

I have investigated this and the reason is that the name of the PID file is determined before double detach from terminal, so the PID in the name refers to one of the parent process. Problem is with the daemonization library, it is written to be generally usable and knows nothing about the name generation, it expects name to be given. There are following possible solutions:

  1. We keep things as they are now. The PID is located inside the PID file, the number in the name is there just for the purpose of uniqueness. This was the original idea, it was never intended to be correct.
  2. We change the daemonizer to be more active in generating the PID file name. It will receive just the base name and it will append the correct PID and .pid extension to it. It will however become more opinionated and less testable. Unless there will be some kind of option to enforce the given static PID file name, it will stop being deterministic in tests.
Actions #4

Updated by Pavel Kácha almost 3 years ago

The PID in the name of the file is there only to easily ensure the filename to be unique. However, it can be misleading for bystander (admin ). So let's make it hexa to strip its likeness to PID and mitigate the possibility of confusion?

Actions #5

Updated by Jan Mach almost 3 years ago

  • Target version changed from Backlog to 2.9
  • To be discussed changed from Yes to No
Actions #6

Updated by Jan Mach almost 3 years ago

  • % Done changed from 0 to 90
Actions #7

Updated by Jan Mach almost 3 years ago

  • Status changed from Feedback to In Progress
Actions #8

Updated by Jan Mach almost 3 years ago

  • Status changed from In Progress to In Review
  • % Done changed from 90 to 100

Deployed to mentat-alt for observation.

Actions #9

Updated by Pavel Kácha over 2 years ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF