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

Add recovery-wrapper for goroutines and migrate most usages #4431

Merged
merged 6 commits into from
Mar 12, 2024

Conversation

dirkkul
Copy link
Contributor

@dirkkul dirkkul commented Mar 8, 2024

Second part of #4329

What's being changed:

Adds a wrapper for goroutines that recovers from panics and migrates most usages of go.

Follow up PR will contain:

  • migration of the remaining direct go usages
  • Custom linter (hopefully)

example looks like this:

{"level":"error","msg":"Recovered from panic: test","time":"2024-03-08T11:57:58+01:00"}
goroutine 79 [running]:
runtime/debug.Stack()
        /opt/homebrew/opt/go/libexec/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
        /opt/homebrew/opt/go/libexec/src/runtime/debug/stack.go:16 +0x1c
github.com/weaviate/weaviate/entities/errors.GoWrapper.func1.1()
        /Users/dirkkulawiak/Documents/weaviate/weaviate/entities/errors/go_wrapper.go:13 +0xa4
panic({0x103d33820?, 0x10407e2d0?})
        /opt/homebrew/opt/go/libexec/src/runtime/panic.go:914 +0x218
github.com/weaviate/weaviate/adapters/repos/db.(*Index).initAndStoreShards.func2()
        /Users/dirkkulawiak/Documents/weaviate/weaviate/adapters/repos/db/index.go:332 +0xa0
github.com/weaviate/weaviate/entities/errors.GoWrapper.func1()
        /Users/dirkkulawiak/Documents/weaviate/weaviate/entities/errors/go_wrapper.go:16 +0x64
created by github.com/weaviate/weaviate/entities/errors.GoWrapper in goroutine 1
        /Users/dirkkulawiak/Documents/weaviate/weaviate/entities/errors/go_wrapper.go:9 +0x80

Review checklist

  • Documentation has been updated, if necessary. Link to changed documentation:
  • Chaos pipeline run or not necessary. Link to pipeline:
  • All new code is covered by tests where it is reasonable.
  • Performance tests have been run or not necessary.

@dirkkul dirkkul force-pushed the panic_handling2 branch 3 times, most recently from 6d21084 to 5cd47d6 Compare March 12, 2024 05:40
@dirkkul dirkkul changed the title Add wrapper for goroutine and migrate most usages Add recovery-wrapper for goroutine and migrate most usages Mar 12, 2024
@dirkkul dirkkul changed the title Add recovery-wrapper for goroutine and migrate most usages Add recovery-wrapper for goroutines and migrate most usages Mar 12, 2024
Copy link

sonarcloud bot commented Mar 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
1.7% Duplication on New Code

See analysis details on SonarCloud

@dirkkul dirkkul merged commit 4339f8a into stable/v1.24 Mar 12, 2024
36 checks passed
@dirkkul dirkkul deleted the panic_handling2 branch March 12, 2024 13: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.

None yet

2 participants