sql, *: simplify remove dependencies on pgerror, util/log#37813
Merged
knz merged 6 commits into20190523-errlib-diffsfrom Jun 18, 2019
Merged
sql, *: simplify remove dependencies on pgerror, util/log#37813knz merged 6 commits into20190523-errlib-diffsfrom
knz merged 6 commits into20190523-errlib-diffsfrom
Conversation
Member
62ecc5e to
082ad10
Compare
eddb962 to
53e49e4
Compare
082ad10 to
39d319a
Compare
53e49e4 to
d93ccf7
Compare
39d319a to
d406ed0
Compare
d93ccf7 to
5fe37e7
Compare
f9c340a to
13559ad
Compare
Contributor
|
LGTM to everything but the last commit; I'm happy to see these changes. |
Contributor
Author
Avoid a cyclic dependency (as usual) |
Contributor
Author
|
Also it's more readable: "pgcode.Foo" is shorter than "pgwire.CodeFoo" |
Contributor
|
Do you remember what the dependency you were breaking was? In any case, LGTM |
5fe37e7 to
3b70f6d
Compare
13559ad to
8095471
Compare
0103736 to
02d7cc4
Compare
bf152aa to
ef803ab
Compare
02d7cc4 to
4f93946
Compare
ef803ab to
8e58782
Compare
4f93946 to
43b2d5e
Compare
This was referenced Jun 18, 2019
8e58782 to
ae7ade0
Compare
43b2d5e to
6f21e35
Compare
ae7ade0 to
511f01f
Compare
6f21e35 to
f557ea1
Compare
511f01f to
dc2b1c1
Compare
f557ea1 to
134b2da
Compare
dc2b1c1 to
7c3c81a
Compare
134b2da to
9766577
Compare
7c3c81a to
684b49b
Compare
9766577 to
027161f
Compare
b47b2b1 to
516c985
Compare
A while ago I had changed many calls to `errors.Errorf`/`errors.New`/`fmt.Errorf`/`errors.Wrap` to use `pgerror` error constructors instead. The goal was to ensure the error objects were decorated with safe details suitable for reporting. However using those APIs also required a pg error code, even in cases where none was obviously available. So I chose then to use the pg code "CodeDataException" as a dummy value. Now that the `errors` library is able to annotate errors in all the good ways, the `pgerror` interface is not needed any more. This commit reverts the past change. This change is nearly all mechanical, using perl. The only manual change is to the function `wrapRowErr` in the `importccl` package. Release note: None
... instead of the aliased definitions in `pgerror`. (This change is entirely mechanical, using perl) Release note: None
Release note: None
... where appropriate. This drops the dependency on `util/log` in many cases. (This change was mechanical, using perl) Release note: None
... and remove pgwire/pgerror/codes.go Release note: None
Previously `teamcity-testrace.sh` would run `testrace` passing all the modified packages simultaneously in the PKG make var. This causes `go test` to issue all the tests concurrently, regardless of available hardware. If there are sufficiently many packages modified, this overloads the machines, makes test run much slower than usual, and triggers bad behavior (timeouts). This patch alleviates the potential problem by running the tests one after the other. Release note: None
684b49b to
dc13807
Compare
516c985 to
6cd22cc
Compare
craig bot
pushed a commit
that referenced
this pull request
Jun 18, 2019
37121: errors: introduce a general-purpose modular error library with good properties r=knz a=knz This PR introduces an error library implemented after the principles laid out in #36987. It subsumes the following two PRs: - #38127 *: demonstrate uses of the errors library - review approval: #38127 (comment) - #37813 sql, *: simplify remove dependencies on pgerror, util/log - review approval: #37813 (comment) Release note: None Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes are mostly mechanical (I used grep and perl, followed by crlfmt).
This compacts the source code: overall -300 locs, and shorter lines.