Skip to content
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

sidecar 方式修改时间会因缺少环境变量导致报错 #25

Open
hduzcc opened this issue Nov 13, 2024 · 4 comments
Open

sidecar 方式修改时间会因缺少环境变量导致报错 #25

hduzcc opened this issue Nov 13, 2024 · 4 comments

Comments

@hduzcc
Copy link

hduzcc commented Nov 13, 2024

https://github.com/CloudNativeGame/fake-time-injector?tab=readme-ov-file#%E6%9B%BF%E4%BB%A3%E6%96%B9%E6%A1%88

@hduzcc
Copy link
Author

hduzcc commented Nov 13, 2024

for modify_process_pid in ${child_pids[@]}
do
echo "start modify process pid: ${modify_process_pid}"
./bin/watchmaker -pid $modify_process_pid -sec_delta $delay_second -nsec_delta $delay_nanosecond -clk_ids "CLOCK_REALTIME,CLOCK_MONOTONIC"
done

@hduzcc
Copy link
Author

hduzcc commented Nov 13, 2024

没有携带delay_nanosecond 环境变量会导致执行报错,我手动执行./bin/watchmaker -pid $modify_process_pid -sec_delta $delay_second -clk_ids "CLOCK_REALTIME,CLOCK_MONOTONIC 可以正常的修改时间

@hduzcc hduzcc changed the title sider sidecar 方式修改时间会因缺少环境变量导致报错 Nov 13, 2024
@hduzcc
Copy link
Author

hduzcc commented Nov 15, 2024

for modify_process_pid in ${child_pids[@]}
do
echo "start modify process pid: ${modify_process_pid}"

command="./bin/watchmaker -pid $modify_process_pid -clk_ids CLOCK_REALTIME,CLOCK_MONOTONIC"

if [ -n "$delay_second" ]; then
command+=" -sec_delta $delay_second"
fi

if [ -n "$delay_nanosecond" ]; then
command+=" -nsec_delta $delay_nanosecond"
fi

eval $command
done

@songkang7
Copy link
Contributor

非常感谢提出问题,可以提个pr,一起完善。

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

No branches or pull requests

2 participants