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

The rasdaemon service may fail to be started for the first time. #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhuofeng6
Copy link

The rasdaemon creates a separate instance virtual directory on first startup, like /sys/kernel/debug/tracing/instances/rasdaemon.

After the directory is created, the kernel generates virtual files such as'trace_clock' and'set_event' in /sys/kernel/debug/tracing/instances/rasdaemon`.

The kernel generates virtual files and the rasdaemon accesses the virtual files at the same time. Therefore, the kernel may not generate the virtual files when the rasdaemon accesses the virtual files.

So add a 100 ms delay to give the kernel enough time to generate the files.

The rasdaemon creates a separate instance virtual directory on first startup, like `/sys/kernel/debug/tracing/instances/rasdaemon`.

After the directory is created, the kernel generates virtual files such as `trace_clock` and `set_event` in `/sys/kernel/debug/tracing/instances/rasdaemon`.

The kernel generates virtual files and the rasdaemon accesses the virtual files at the same time. Therefore, the kernel may not generate the virtual files when the rasdaemon accesses the virtual files.

So add a 100 ms delay to give the kernel enough time to generate the files.

Signed-off-by: zhuofeng <zhuofeng2@huawei.com>
char fname[MAX_PATH + 1];

strcpy(fname, ras->tracing);
strcat(fname, "/");
strcat(fname, name);

return open(fname, flags);
ret = wait_access(fname, 100);
Copy link
Owner

Choose a reason for hiding this comment

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

Nothing warrants that 100ms is enough. I would setup it a way bigger, like 30 seconds, as having rasdaemon failing means that RAS instrumentation won't be in place.

Granted, on normal situations, this will be solved a way faster, but the server might be on high load. So, a long timeout won't hurt.

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.

None yet

2 participants