Skip to content

Conversation

@hermanschaaf
Copy link
Member

By default, commands in Go are started in the same process group. When a signal is sent (e.g. ctrl+c), this gets sent to the entire group, causing plugins to shut down before the CLI has a chance to do closing operations and then relay the signal. By setting Setpgid: true on UNIX systems, we can get better control over the shutdown process of child processes.

@hermanschaaf
Copy link
Member Author

Oh okay, this field is not even available on Windows :) I will refactor a bit

@codecov-commenter
Copy link

Codecov Report

Base: 47.16% // Head: 47.21% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (8366e53) compared to base (5aebba3).
Patch coverage: 100.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #664      +/-   ##
==========================================
+ Coverage   47.16%   47.21%   +0.04%     
==========================================
  Files          70       70              
  Lines        6736     6742       +6     
==========================================
+ Hits         3177     3183       +6     
  Misses       3111     3111              
  Partials      448      448              
Impacted Files Coverage Δ
clients/destination/v0/destination.go 36.25% <100.00%> (+0.24%) ⬆️
clients/destination/v0/destination_unix.go 45.16% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

github-actions bot commented Feb 7, 2023

⏱️ Benchmark results

  • DefaultConcurrencyDFS-2 resources/s: 11,344
  • DefaultConcurrencyRoundRobin-2 resources/s: 12,403
  • Glob-2 ns/op: 185.4
  • TablesWithChildrenDFS-2 resources/s: 29,111
  • TablesWithChildrenRoundRobin-2 resources/s: 30,532
  • TablesWithRateLimitingDFS-2 resources/s: 28.16
  • TablesWithRateLimitingRoundRobin-2 resources/s: 820.4
  • BufferedScanner-2 ns/op: 9.292
  • LogReader-2 ns/op: 31.17

@kodiakhq kodiakhq bot merged commit 2883487 into main Feb 8, 2023
@kodiakhq kodiakhq bot deleted the setpgid branch February 8, 2023 15:38
kodiakhq bot pushed a commit that referenced this pull request Feb 8, 2023
🤖 I have created a release *beep* *boop*
---


## [1.36.0](v1.35.0...v1.36.0) (2023-02-08)


### Features

* Add table diff methods ([#668](#668)) ([f6baa82](f6baa82))
* Use Setpgid=true on Unix systems so that signals are not sent to the child process ([#664](#664)) ([2883487](2883487))


### Bug Fixes

* Remove duplicate force implementation ([#670](#670)) ([fe34554](fe34554))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
kodiakhq bot pushed a commit to cloudquery/cloudquery that referenced this pull request Feb 27, 2023
…ruptly (#7756)

Before, when pressing ctrl+c, these messages would show in the CLI:

```
failed to terminate destination client:  destination plugin process exited with status signal: killed
failed to terminate source client:  source plugin process exited with status signal: killed
```

This PR fixes it so that these messages no longer appear. This is the main user-facing change. 

Other changes include:
 - sending an analytics message when the sync ends for any reason, rather than only on successful syncs
 - include an "exit reason" in the analytics message, so that we can better understand when and why syncs fail
 - introduction of an `CQ_ANALYTICS_HOST` environment variable that can override the default host. This is mainly useful for testing, so no code changes are necessary to send analytics to a test server. For normal operation, users should still use `--telemetry-level` or `CQ_TELEMETRY_LEVEL` to control the telemetry
 - send analytics not only for the GitHub registry, but also for path and grpc registries. This can help us better understand how plugins are being deployed. We strip off any potentially identifying information and send only the final part of the path (i.e. the name of the binary)

This change will be improved by cloudquery/plugin-sdk#664 but doesn't depend on it to work.
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.

5 participants