Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: The process_running function in node/misc/usr/lib/cartridge_sdk/bash/sdk uses "pgrep -F" to determine whether a cartridge's processes are running. The problem is that with this option, pgrep checks for these PIDs by traversing /proc. It turns out that if another gear has a process with the pid being checked, pgrep -F will find it. As a result, if gear A has a stale pidfile containing a pid matching a long-running process belonging to gear B, gear B will effectively prevent gear A from running, unless the owner knows to go remove the stale pid file. Version-Release number of selected component (if applicable): rubygem-openshift-origin-node-1.26.8-1.el6oso.noarch How reproducible: Easily Steps to Reproduce: 1. rhc app create bztest nodejs-0.10 postgresql-9.2 2. rhc app stop 3. rhc ssh bztest 4. look in /proc for a process belonging to another gear (referred to below as $PID) 5. echo $PID > postgresql/pid/postgres.pid 6. gear start Actual results: start will fail for postgres with code 70 Expected results: start should succeed
Fixed in https://github.com/openshift/origin-server/pull/5575
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/16eb8a6e98def5a8c830757ad9fa9c0a3a3b4afe Bug 1116135 - Add -u to bash sdk pgrep calls * Since gears can "see" another gears pid files in the /proc filesystem, a stale pid file could block a cartridge from starting via the check in sdk#process_running()
Checked on devenv_4944, issue has been fixed. cartridge pid file contains pid owned by other user will not block the gear start.