Giter VIP home page Giter VIP logo

Comments (3)

aeldaly avatar aeldaly commented on September 2, 2024

Also, it's not really logging anything to the log file

from daemons.

aeldaly avatar aeldaly commented on September 2, 2024

Another weirdness...

Changed runner to this:

#!/usr/bin/env ruby

require 'daemons'

Daemons.run(
  './script/startup/jobs',
  dir_mode: :normal,
  dir: '/var/app/support/pids',
  log_dir: '/var/app/support/logs/',
  logfilename: 'async_runner.log',
  backtrace: '/var/app/support/logs/async_runner.error.log',
  multiple: true
)

And then did the below:

[root@ip-172-30-4-194 current]# ./script/startup/async_runner start
[root@ip-172-30-4-194 current]# cat ../support/pids/jobs_num0.pid
17433
[root@ip-172-30-4-194 current]# ps ax | grep jobs
17450 ?        Sl     0:00 jobs
17479 pts/2    S+     0:00 grep --color=auto jobs
[root@ip-172-30-4-194 current]# cat ../support/pids/jobs_num0.pid
cat: ../support/pids/jobs_num0.pid: No such file or directory

So the pid inside the file is not the same as the running process, and then the pid file disappears. Calling stop at this point does nothing.

from daemons.

thuehlinger avatar thuehlinger commented on September 2, 2024

Which Ruby gem does AsyncRunner originate from? I do not see an import in your code. I guess that AsyncRunner is created new processes for the tasks which are then obviously
not tracked by daemons. The main spawned process exits after having created the tasks and therefore its .pid file will be cleaned up. I guess its just not a good idea to combine AsyncRunner and daemons. What you actually want is having :multiple set to true and then call your ./script/startup/async_runner startas many times as the number of desired worker processes.

from daemons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.