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

Better RUNTIME_CHECK and RUNTIME_ASSERT #5444

Closed
fuzhe1989 opened this issue Jul 21, 2022 · 0 comments · Fixed by #5434
Closed

Better RUNTIME_CHECK and RUNTIME_ASSERT #5444

fuzhe1989 opened this issue Jul 21, 2022 · 0 comments · Fixed by #5434
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@fuzhe1989
Copy link
Contributor

fuzhe1989 commented Jul 21, 2022

Enhancement

RUNTIME_CHECK

Current RUNTIME_CHECK usage is:

RUNTIME_CHECK(a != b, ExceptionType, "{} != {}", a, b);

It's not clear for users to know which exception will be thrown. A better way is to explicit write code for generating an exception object like:

RUNTIME_CHECK(a != b, ExceptionType("{} != {}", a, b));

And the new style could enable better compilation checks.

RUNTIME_ASSERT

Current RUNTIME_ASSERT always needs a logger and make it hard for replacing existent asserts. We should let it work without user provided logger (in which case a default logger is used).

@fuzhe1989 fuzhe1989 added the type/enhancement The issue or PR belongs to an enhancement. label Jul 21, 2022
JaySon-Huang pushed a commit to ti-chi-bot/tiflash that referenced this issue Aug 31, 2022
close pingcap#5444

 Conflicts:
	dbms/src/Common/FailPoint.cpp
	dbms/src/Common/FailPoint.h
	dbms/src/Flash/Coprocessor/DAGQueryBlockInterpreter.cpp
	dbms/src/Flash/Mpp/ExchangeReceiver.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant