-
Notifications
You must be signed in to change notification settings - Fork 1
Ideas
John Bachir edited this page Oct 17, 2024
·
4 revisions
- Support for tests: https://github.com/jjb/ruby-clock/issues/38
- avoid mutex in shutdown https://github.com/jjb/ruby-clock/pull/41, https://github.com/jjb/ruby-clock/pull/42
- Support clockfile.rb (lowercase with the extension)
- Explore behavior of shutdown when shell commands are running
- https://github.com/jjb/ruby-clock/commit/300de3f621bd72fcd106a12500b8c3055545329d
- https://stackoverflow.com/questions/69653842/why-does-the-presence-of-a-forked-process-in-a-thread-change-the-behavior-of-sle
- https://gist.github.com/lpar/1032297
- https://github.com/kamstrup/command_runner_ng
- https://www.ruby-forum.com/t/executing-system-commands-in-threads-under-ruby-1-8-6/175066
- https://saveriomiroddi.github.io/Executing-and-killing-ruby-parallel-background-jobs/
- detect error condition in at_exit and log it and report it to the error reporter
for example if a process dies because of out of memory
class RunnerErrorReporter < Rails::Railtie def system_exit_reducer(error, count = 0) if 'exit' != error.message.strip || !error.cause [error, count] else system_exit_reducer(error.cause, count + 1) end end runner do at_exit do next unless $! next if SystemExit == $!.class && $!.success? # could start doing something like this, but first want to make sure # other cases are working as expected. # if SignalException == $!.class && 'SIGTERM' == $!.signm # Rails.logger.info(received sigterm blah blah) error, system_exit_count = system_exit_reducer($!) custom_data = { invocation: `ps -p #{$PROCESS_ID} -o comm=`.strip, program_name: $PROGRAM_NAME, arguments: $*.join(" "), system_exit_count: system_exit_count, signal: [$!, error].map{ |e| e.try(:signm) }.join(', ') } ErrorReporter.track_exception(error, custom_data: custom_data, tags: ['runner']) end end end