sensu / sensu-omnibus

Build full-stack platform-specific Sensu packages
12 stars 16 forks source link

Ruby 2.4 issue #13794 affects sensu-client on AIX #250

Closed liudasbk closed 6 years ago

liudasbk commented 6 years ago

Embedded ruby 2.4 has a bug where process goes to infinite loop of sched_yield() in some cases. It happens when Sensu executes a check on AIX platform (in Kernel.exec() call within the child process). Sensu uses childprocess to execute checks and because there is no FFI support on AIX, childprocess uses frok() and exec() instead of posix_spanwp() as on other platforms.

Bug #13794: Infinite loop of sched_yield https://bugs.ruby-lang.org/issues/13794

Patch: https://80x24.org/spew/20170809232533.14932-1-e@80x24.org/raw

The patch is included in ruby_2_5 branch: https://github.com/ruby/ruby/blob/ruby_2_5/thread_pthread.c#L1312

I think this patch could be included into AIX package build process.

Workaround

Workaround could be to define timeout for each check so child process is killed when goes to infinite loop.

cwjohnston commented 6 years ago

Looks like this patch has landed in Ruby 2.4 branch (see http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/84870). Anticipating that this change will ship in Ruby 2.4.4, we will plan to include that new version in a future Sensu Core release.

annaplotkin commented 6 years ago

This will be resolved with the same resolution as #1867

portertech commented 6 years ago

Closed by https://github.com/sensu/sensu-omnibus/pull/273 Sensu Core 1.5.0 packages will include the Ruby patch level bump

portertech commented 6 years ago

If the behaviour continues after the upgrade (soon) we can reopen this issue.