Skip to content

feat: Instantiate services at sync time rather than during init phase of sync#13059

Merged
hermanschaaf merged 35 commits intomainfrom
init-service-at-sync
Aug 15, 2023
Merged

feat: Instantiate services at sync time rather than during init phase of sync#13059
hermanschaaf merged 35 commits intomainfrom
init-service-at-sync

Conversation

@bbernays
Copy link
Copy Markdown
Collaborator

Summary

This will reduce memory usage in most cases, unless a user is running tables:["*"]. This will instantiate the service client the first time a client needs it rather than instantiating every single supported client during initialization phase of the sync.

If a user doesn't use a service, it will never be instantiated

Backend state.Client
specificRegions bool
Spec *Spec
// Do not rely on this field, it will be removed once https://github.com/aws/aws-sdk-go-v2/issues/2163 is resolved
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf Aug 15, 2023

Choose a reason for hiding this comment

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

Is this comment not longer true? Will we keep AWSConfig?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We will need to because the initService function uses it to initialize the service:

func (s *Services) InitService(awsConfig *aws.Config, service string) {
	c := awsConfig.Copy()

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.

Couple of suggestions & questions but overall LGTM and I like the idea!

@hermanschaaf
Copy link
Copy Markdown
Contributor

hermanschaaf commented Aug 15, 2023

Because this PR touches more than 500 files we will have to manually merge it (I'll do so once the checks pass)

@hermanschaaf hermanschaaf merged commit 99e6889 into main Aug 15, 2023
@hermanschaaf hermanschaaf deleted the init-service-at-sync branch August 15, 2023 17:55
kodiakhq bot pushed a commit that referenced this pull request Aug 21, 2023
🤖 I have created a release *beep* *boop*
---


## [22.7.0](plugins-source-aws-v22.6.0...plugins-source-aws-v22.7.0) (2023-08-21)


### Features

* Instantiate services at sync time rather than during init phase of sync ([#13059](#13059)) ([99e6889](99e6889))


### Bug Fixes

* AWS foundational security controls for S3.8 query reference ([#13065](#13065)) ([7cde3d2](7cde3d2)), closes [#13064](#13064)
* **deps:** Update AWS modules ([#13246](#13246)) ([49ee475](49ee475))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 5b83d4f ([#13203](#13203)) ([b0a4b8c](b0a4b8c))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.5.1 ([#13195](#13195)) ([a184c37](a184c37))
* Panic while fetching `aws_codecommit_repositories` ([#13223](#13223)) ([4d9bcc1](4d9bcc1))
* Remove unused query ([#13152](#13152)) ([f050699](f050699))

---
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants