Skip to content

fix(sentry): Use HTTPSyncTransport, remove flush#465

Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/flush_sentry
Dec 6, 2022
Merged

fix(sentry): Use HTTPSyncTransport, remove flush#465
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/flush_sentry

Conversation

@erezrokah
Copy link
Copy Markdown
Member

@erezrokah erezrokah commented Dec 6, 2022

Summary

This PR switches Sentry to work in synchronous mode (like we have in the CLI).

We can't rely on sentry.Flush begin called in a consistent way, especially on Windows since it doesn't support sending an interrupt signal and kills the process immediately:

if err := c.cmd.Process.Kill(); err != nil {

This might have a performance tradeoff, but since we use it for errors/panics only we think that should be ok.
Another solution @disq suggested would be to call sentry.Flush after the sync for example in source plugins.


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@github-actions github-actions bot added fix and removed fix labels Dec 6, 2022
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 6, 2022

⏱️ Benchmark results

  • DefaultConcurrency-2 resources/s: 11,853
  • Glob-2 ns/op: 213.1
  • TablesWithChildrenDefaultConcurrency-2 resources/s: 26,678
  • BufferedScanner-2 ns/op: 13.33
  • LogReader-2 ns/op: 41.55

Copy link
Copy Markdown
Member

@disq disq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we verify this is the fix and start getting the panic reports again, we can do another pass to optimize (maybe fall back to HTTPTransport without the sync, but do a blocking Flush() in critical points etc)

Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

@github-actions github-actions bot added fix and removed fix labels Dec 6, 2022
@kodiakhq kodiakhq bot merged commit 4d48306 into cloudquery:main Dec 6, 2022
kodiakhq bot pushed a commit that referenced this pull request Dec 7, 2022
🤖 I have created a release *beep* *boop*
---


## [1.11.1](v1.11.0...v1.11.1) (2022-12-07)


### Bug Fixes

* **codegen:** Column type for slices ([7474c90](7474c90))
* Concurrent read,write to a map ([#467](#467)) ([ebef24a](ebef24a))
* **sentry:** Use HTTPSyncTransport, remove flush ([#465](#465)) ([4d48306](4d48306))
* Skip relations when initializing metrics ([#469](#469)) ([5efe564](5efe564))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants