Skip to content

enh: simulate random i/o error #27155

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 12 commits into from
Aug 13, 2024
Merged

enh: simulate random i/o error #27155

merged 12 commits into from
Aug 13, 2024

Conversation

kailixu
Copy link
Contributor

@kailixu kailixu commented Aug 12, 2024

No description provided.

@@ -64,6 +64,20 @@ typedef struct TdFile {

#define FILE_WITH_LOCK 1

#ifdef BUILD_WITH_RAND_ERR
Copy link
Contributor

Choose a reason for hiding this comment

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

类似这样的宏潘魏应该已经加过了,不需要重复加,只要在特定地方用它就行了。如果觉得他的宏名字起得不够通用,可以把名字改得通用一些。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

潘魏暂未定义类似的宏;资源类的随机失败常见的也就是内存和文件;如果要增加公共宏,可以放在 tutil.h 或是 tdef.h,而 tutil.h 引用了其他头文件,因此在使用 tutil.h 时会引入一些新的头文件,tdef.h 基本是一些常量类型的定义,所以两个位置都感觉不是很好。基于以上几点,暂未增加公用的宏,如果以后还要继续增加其他类型的资源随机失败,再考虑将 osFile.c/osMemory.c 的定义提取出来。

@hzcheng hzcheng merged commit b5951a9 into 3.0 Aug 13, 2024
1 check passed
@kailixu kailixu deleted the enh/TD-31375-3.0 branch August 14, 2024 01:08
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.

3 participants