Cake-Resque icon indicating copy to clipboard operation
Cake-Resque copied to clipboard

Where's the pid files?

Open davidsteinsland opened this issue 10 years ago • 8 comments

I've specified an alternate location of the pid files, and they are showing up in the commands:

PIDFILE='/var/www/releases/1446826801/tmp/resque/14468555833567'

No file with that path exists, nor does the logs contain any information as to why it doesn't. When no pid file exists, I cannot stop the workers via the console shell, I have to kill them manually.

On a second note, the LOGHANDLERTARGET is also set:

/var/www/releases/1446826801/tmp/logs/resque.log

This file doesn't exist either.

davidsteinsland avatar Nov 07 '15 00:11 davidsteinsland

Are you using capistrano or similar tools for deployment ?

wa0x6e avatar Nov 09 '15 12:11 wa0x6e

Yes, I'm using DeployBot.

davidsteinsland avatar Nov 09 '15 12:11 davidsteinsland

Does deploybot have a shared folder ? Pid files should reside in a shared folder, so that file persists between deploy.

On Monday, 9 November 2015, David Steinsland [email protected] wrote:

Yes, I'm using DeployBot.

— Reply to this email directly or view it on GitHub https://github.com/wa0x6e/Cake-Resque/issues/96#issuecomment-155051177.

wa0x6e avatar Nov 09 '15 18:11 wa0x6e

Yes, all that is taken care off.

davidsteinsland avatar Nov 09 '15 18:11 davidsteinsland

The tmp folder is shared between deployment ?

On Tuesday, 10 November 2015, David Steinsland [email protected] wrote:

Yes, all that is taken care off.

— Reply to this email directly or view it on GitHub https://github.com/wa0x6e/Cake-Resque/issues/96#issuecomment-155150131.

wa0x6e avatar Nov 09 '15 18:11 wa0x6e

Again, yes. Permissions are OK. Problem is not with my setup. As I said initially, the processes are started with the correct environment variables. So any failure should be logged, and it isnt.

davidsteinsland avatar Nov 09 '15 21:11 davidsteinsland

Ca you post the full deployment log for DeployBot ?

wa0x6e avatar Nov 13 '15 09:11 wa0x6e

@davidsteinsland

I've specified an alternate location of the pid files, and they are showing up in the commands:

You didn't mentioned it specifically, but if you mean CakeResque.Resque.tmpdir: I did a analysis recently and found out that these PID files are only very short lived and used to check if the worker properly started and are then removed from the file system:

  1. pidfile created
    https://github.com/wa0x6e/Cake-Resque/blob/3ea90434e478b24629d55d9aed43a2a5a4004a1d/src/Shell/CakeResqueShell.php#L825
  2. worker spawned
    https://github.com/wa0x6e/Cake-Resque/blob/3ea90434e478b24629d55d9aed43a2a5a4004a1d/src/Shell/CakeResqueShell.php#L860
  3. pidfile passed to _checkStartedWorker
    https://github.com/wa0x6e/Cake-Resque/blob/3ea90434e478b24629d55d9aed43a2a5a4004a1d/src/Shell/CakeResqueShell.php#L873
  4. in _checkStartedWorker: pidfile removed
    https://github.com/wa0x6e/Cake-Resque/blob/3ea90434e478b24629d55d9aed43a2a5a4004a1d/src/Shell/CakeResqueShell.php#L1072

Only within redis the PIDs are permanently persisted for the lifetime of a worker.

mfn avatar Dec 10 '15 15:12 mfn