-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
remove mock.Context
usage in production code
#53388
Labels
type/enhancement
The issue or PR belongs to an enhancement.
Comments
13 tasks
This was referenced May 21, 2024
RidRisR
pushed a commit
to RidRisR/tidb
that referenced
this issue
May 23, 2024
This was referenced May 29, 2024
This was referenced May 30, 2024
13 tasks
Merged
13 tasks
13 tasks
13 tasks
13 tasks
13 tasks
13 tasks
13 tasks
winoros
pushed a commit
to winoros/tidb
that referenced
this issue
Sep 23, 2024
This was referenced Sep 26, 2024
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enhancement
It's better to remove the
mock.Context
usages in TiDB production code. The reason is thatmock.Context
is not designed for production code. It is designed for testing, that means some values in it are not reasonable in production and some values will be modified by the developer without any care.We can replace some code that uses
mock.Context
with some "static" context we introduced before such asStaticExprContext
orDistSQLContext
Tasks
mock.Context
ref inddl/session/session_pool.go
#53378newReorgExprCtx
to replacemock.Context
usage #53389CtxWithHandleTruncateErrLevel
to wrap a expression context to handle truncate error #53441newDefaultReorgDistSQLCtx
to replace mock context in DDL reorg #53467mock.Context
usage inaddIndexIngestWorker
#53479sessionctx.Context
to sub contexts inCopContextBase
#53642sessionctx.Context
inbackfillCtx
to sub-contexts #53671CopContextBase
#53721NewReorgCopContext
#55823mock.Context
from DDL reorg #55873session
#56174metabuild.Context
to build meta #56176mock.NewContext()
usage when building table meta in production code #56348exprstatic.ExprContext
to replacemock.Context
inToConstraint
#56355mock.NewContext
in production code #56654The text was updated successfully, but these errors were encountered: