Skip to content

Commit a3841bd

Browse files
Merge pull request red-hat-storage#1327 from rewantsoni/ocs-must-gather
must-gather: wait for PIDs to be avaliable
2 parents 50c0f3a + 590db30 commit a3841bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

must-gather/collection-scripts/gather_ceph_resources

+8
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ for ns in $namespaces; do
116116
pids_ceph+=($!)
117117
{ timeout 120 oc -n "${ns}" exec "${HOSTNAME}"-helper -- bash -c "${ceph_commands[$i]} --connect-timeout=15 --format json-pretty" >> "${JSON_COMMAND_OUTPUT_FILE}"; } >> "${COMMAND_ERR_OUTPUT_DIR}"/gather-"${ceph_commands[$i]}"-json-debug.log 2>&1 &
118118
pids_ceph+=($!)
119+
120+
# CRI-O have a limitation to upper limit to number of PIDs, so we found that when `ps aux | wc -l` exceeds 115 the resource cannot be collected
121+
# hence to keep a buffer, we are waiting for 2 seconds until we have PIDs available, https://access.redhat.com/solutions/5597061
122+
while [ "$(ps aux | wc -l)" -gt 100 ]
123+
do
124+
printf "waiting for PIDs to be empty before proceeding \n" | tee -a "${BASE_COLLECTION_PATH}"/gather-ceph-debug.log
125+
sleep 2
126+
done
119127
done
120128
for i in $(timeout 120 oc -n "${ns}" exec "${HOSTNAME}"-helper -- bash -c "ceph osd lspools --connect-timeout=15"|awk '{print $2}'); do
121129
{ timeout 120 oc -n "${ns}" exec "${HOSTNAME}"-helper -- bash -c "rbd ls -p $i" >> "${COMMAND_OUTPUT_DIR}/pools_rbd_$i"; } >> "${COMMAND_ERR_OUTPUT_DIR}"/gather-rbd-"$i"-debug.log 2>&1 &

0 commit comments

Comments
 (0)