Skip to content

Added a timeout to pin_thread. #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2025

Conversation

pveentjer
Copy link
Contributor

Also 2 cleanups were done to improve readability:

  1. the string is placed over multiple lines
  2. the variable containing the cmd to get the tid, is now renamed from tid to tid_cmd.

@pveentjer pveentjer force-pushed the fix/pin-thread-timeout branch from 1cb799a to fecd011 Compare June 19, 2025 07:47
@pveentjer pveentjer requested a review from vyazelenko June 19, 2025 08:06
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra empty line

Comment on lines 192 to 206
echo "
echo 'Pinning thread: ${thread_name}'
count=0
tid=${tid_cmd}
while [ -z \"\${tid}\" ] && [ \${count} -lt 600 ]; do
sleep 0.1
tid=${tid_cmd}
count=\$((count + 1))
done
if [ -z \"\${tid}\" ]; then
echo 'Timeout: thread ${thread_name} not found after 60 seconds.'
exit 1
fi
echo \"tid_${thread_name}='\${tid}'\"
taskset -p -c ${core} \${tid}
"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a set -e to support multi line?

Copy link
Contributor Author

@pveentjer pveentjer Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the original code, the commands are not joined by a &&, but a ;. So you continue to the next no matter if the previous command fails. The current code has exactly the same semantics.

But I think setting 'set -e' would be better. There is no point continuing to the next line if the previous failed.

Also 2 cleanups were done to improve readability:

1) the string is placed over multiple lines
2) the variable containing the cmd to get the tid, is now renamed
from tid to tid_cmd.
@vyazelenko vyazelenko merged commit 3d74757 into aeron-io:master Jun 19, 2025
4 checks passed
@pveentjer pveentjer deleted the fix/pin-thread-timeout branch June 19, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants