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

chore: Update go to v1.23.0 #15766

Merged
merged 20 commits into from
Aug 30, 2024
Merged

chore: Update go to v1.23.0 #15766

merged 20 commits into from
Aug 30, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Aug 21, 2024

Summary

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15746

@telegraf-tiger telegraf-tiger bot added the chore label Aug 21, 2024
@srebhan srebhan added the go Pull requests that update Go code label Aug 21, 2024
@srebhan srebhan self-assigned this Aug 21, 2024
Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

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

Have min and max now become a reserved word or something? 😂

@srebhan
Copy link
Member Author

srebhan commented Aug 26, 2024

@Hipska yes. Those are builtin functions since go v1.21...

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@mskonovalov
Copy link
Contributor

mskonovalov commented Aug 29, 2024

I guess the issue may be related to golangci/golangci-lint#4837 (comment)
or golangci/golangci-lint#4908 (comment)
Although log says

golangci-lint has version v1.60.3 built with go1.23.0

@srebhan
Copy link
Member Author

srebhan commented Aug 29, 2024

@mskonovalov the issue is that the CircleCI instance runs out-of-memory unfortunately. In the past we were able to tune the garbage collection params but this doesn't seem to work this time...

@zak-pawel
Copy link
Collaborator

It looks like go 1.23.0 and/or golangci-lint 1.60.x need more memory to complete the scan than previous versions, and tweaking GOGC and GOMEMLIMIT wasn't enough this time.

But I found something else. When I started playing around with GODEBUG=gctrace=1, I discovered that golangci-lint uses 36 logical CPUs to perform the scan. However, the Docker / Large setup only has 4 vCPUs:
image

By default, golangci-lint uses as many CPUs as there are logical CPUs available. It turns out that the system is reporting the number of processors on the host, rather than the number available within the Docker executor.

Confirmation here:
image
(https://discuss.circleci.com/t/x86-vm-cpu-ram-size-mismatch/45779/6)

And here:
image
(https://app.circleci.com/pipelines/github/influxdata/telegraf/22537/workflows/43957c5b-61fa-4de1-b1b9-2ca3a29c9581/jobs/350312)

Using only as many CPUs as are actually available to the guest (4 instead of 36) speeds up the jobs (less CPU time spent in garbage collection) and reduces memory usage/makes garbage collection more efficient (with parallel linter threads, using fewer processors allows for a more efficient "stop the world" phase).

@srebhan
Copy link
Member Author

srebhan commented Aug 30, 2024

This is really amazing! Thanks for hunting down and fixing the issue @zak-pawel!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Aug 30, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Aug 30, 2024
@p-zak p-zak added the linter label Aug 30, 2024
@telegraf-tiger
Copy link
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

🥳 This pull request decreases the Telegraf binary size by -1.27 % for linux amd64 (new size: 260.7 MB, nightly size 264.0 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

@DStrand1 DStrand1 merged commit b2967cb into influxdata:master Aug 30, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.32.0 milestone Aug 30, 2024
asaharn pushed a commit to asaharn/telegraf that referenced this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore go Pull requests that update Go code linter ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: support new golang version 1.23.0
6 participants