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

[Refactoring]: fix cases marked by linter errcheck for package github.com/matrixorigin/matrixone/pkg/vm/engine #2523

Closed
1 task done
cnutshell opened this issue May 13, 2022 · 5 comments
Assignees
Labels
Milestone

Comments

@cnutshell
Copy link
Contributor

cnutshell commented May 13, 2022

Is there an existing issue for the refactoring request?

  • I have checked the existing issues.

Is your refactoring request related to a problem?

We should check all the cases marked by linter errcheck.
Errcheck is a program for checking for unchecked errors in go programs. 
These unchecked errors can be critical bugs in some cases.

Describe the solution you'd like

Check all the cases marked by linter errcheck and evaluate them.
If an unchecked error can be critical bugs in some cases, then fix it.

Describe alternatives you've considered

No response

Additional information

How to find all the cases via errcheck for package github.com/matrixorigin/matrixone/pkg/vm/engine:

git clone https://github.com/matrixorigin/matrixone.git
cd matrixone
## This will show all the cases for both normal code and test code
golangci-lint run --disable-all -E errcheck \
    --max-same-issues 10000 --max-issues-per-linter 10000 pkg/vm/engine/...

If you want to find cases for non-test code only, using option --skip-files ".+_test.go":

golangci-lint run --disable-all -E errcheck \
    --max-same-issues 10000 --max-issues-per-linter 10000 --skip-files ".+_test.go" pkg/vm/engine/...

The output of this command would be:

pkg/vm/engine/tae/tables/blocktasks.go:87:26: Error return value of `blk.scheduler.Checkpoint` is not checked (errcheck)
	blk.scheduler.Checkpoint(indexes)
	                        ^
@cnutshell
Copy link
Contributor Author

Related issue #2133

@cnutshell cnutshell changed the title [Refactoring]: fix cases marked by linter errcheck for package github.com/matrixorigin/matrixone/pkg/vm/engine/tae [Refactoring]: fix cases marked by linter errcheck for package github.com/matrixorigin/matrixone/pkg/vm/engine May 13, 2022
@XuPeng-SH XuPeng-SH added the kind/refactor Code refactor label May 14, 2022
@XuPeng-SH
Copy link
Contributor

  1. txn/ @XuPeng-SH
  2. tables/ @XuPeng-SH
  3. catalog/ @XuPeng-SH
  4. iface/ mock/ model/ moengine/ options/ samples/ wal/ testutils/ tasks/ common/ @XuPeng-SH
  5. dataio/ index/ container/ @LeftHandCold
  6. logstore/ db/ tasks/ @jiangxinmeng1

@yingfeng
Copy link
Contributor

yingfeng commented May 16, 2022

TPE errcheck @daviszhen

golangci-lint run --disable-all -E errcheck     --max-same-issues 10000 --max-issues-per-linter 10000 --skip-files ".+_test.go" pkg/vm/engine/tpe...
pkg/vm/engine/tpe/engine/toolKitHandler.go:188:23: Error return value is not checked (errcheck)
                dumpTableDataToshell(opt, result)
                                    ^
pkg/vm/engine/tpe/engine/toolKitHandler.go:190:22: Error return value is not checked (errcheck)
                dumpTableDataToFile(opt, result)
                                   ^
pkg/vm/engine/tpe/tuplecodec/util.go:616:23: Error return value of `pprof.StartCPUProfile` is not checked (errcheck)
        pprof.StartCPUProfile(cpuf)

@cnutshell
Copy link
Contributor Author

cnutshell commented May 16, 2022

For commit 00050728be, there are still 62 (186/3) cases within pkg/vm/engine/...

golangci-lint run --disable-all -E errcheck  \
    --max-same-issues 10000 --max-issues-per-linter 10000 \
    --skip-files ".+_test.go" pkg/vm/engine/... | wc -l
     186

@JinHai-CN
Copy link
Contributor

JinHai-CN commented Jul 10, 2022

Since the code is refactored, new issue #3853 will track the lint error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants