Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 10, 2024

Proposed commit message

Go 1.19 added new atomic types. Replace custom atomic types with stdlib atomic package to fully use the race detector, improved lsp hints and support.

Use pointers in sniffer struct to prevent copying the atomic struct and cause a race condition.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs


This is an automatic backport of pull request #40132 done by [Mergify](https://mergify.com).

* feat: replace custom atomic with sync/atomic

Go 1.19 added new atomic types. Replace custom atomic types with stdlib atomic package
to fully use the race detector, improved lsp hints and support.

Use pointers in sniffer struct to prevent copying the atomic struct and cause
a race condition.

* lint: time.Now().Sub -> time.Since

fix golangci-lint issue

* Apply suggestions from code review

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>

* refactor: keep Swap usage as is

* lint: avoid unnecessary conversion

fix golangci-lint issue

* fix: update method reference to new atomic types

* fix: resolve more compile errors and test failures

* lint: fix linter issues

* lint: fix linter issues

* lint: fix linter issues

* lint: fix linter issues

* lint: more linting errors

* lint: fix linter issues

* lint: remove unused import

* lint: fix linter issue

* lint: fix linter issues

* lint: fix linter issues

---------

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
(cherry picked from commit 296b83b)

# Conflicts:
#	filebeat/inputsource/common/streaming/listener.go
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Dec 10, 2024
@mergify mergify bot requested review from a team as code owners December 10, 2024 22:10
@mergify mergify bot requested a review from a team as a code owner December 10, 2024 22:10
@mergify
Copy link
Contributor Author

mergify bot commented Dec 10, 2024

Cherry-pick of 296b83b has failed:

On branch mergify/bp/8.x/pr-40132
Your branch is up to date with 'origin/8.x'.

You are currently cherry-picking commit 296b83b6c5.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   filebeat/channel/outlet.go
	modified:   filebeat/input/filestream/internal/input-logfile/harvester_test.go
	modified:   filebeat/input/filestream/internal/input-logfile/store.go
	modified:   filebeat/input/kafka/input.go
	modified:   filebeat/input/log/input.go
	modified:   filebeat/input/v2/input-cursor/store.go
	modified:   filebeat/input/v2/input-stateless/stateless_test.go
	modified:   heartbeat/monitors/factory_test.go
	modified:   heartbeat/monitors/mocks.go
	modified:   heartbeat/monitors/monitor_test.go
	modified:   heartbeat/scheduler/schedjob.go
	modified:   heartbeat/scheduler/schedjob_test.go
	modified:   libbeat/common/acker/acker.go
	deleted:    libbeat/common/atomic/atomic.go
	deleted:    libbeat/common/atomic/atomic32.go
	deleted:    libbeat/common/atomic/atomic64.go
	deleted:    libbeat/common/atomic/atomic_test.go
	modified:   libbeat/idxmgmt/index_support.go
	modified:   libbeat/management/agent.go
	modified:   libbeat/outputs/elasticsearch/client_proxy_test.go
	modified:   libbeat/outputs/logstash/async.go
	modified:   libbeat/processors/add_process_metadata/add_process_metadata.go
	modified:   libbeat/processors/cache/cache.go
	modified:   libbeat/processors/dns/dns.go
	modified:   libbeat/processors/ratelimit/rate_limit.go
	modified:   libbeat/processors/ratelimit/token_bucket.go
	modified:   libbeat/processors/syslog/syslog.go
	modified:   libbeat/publisher/pipeline/client.go
	modified:   libbeat/publisher/pipeline/client_worker_test.go
	modified:   libbeat/publisher/pipeline/controller_test.go
	modified:   libbeat/publisher/pipeline/pipeline.go
	modified:   libbeat/publisher/pipeline/pipeline_test.go
	modified:   libbeat/publisher/pipeline/stress/gen.go
	modified:   libbeat/publisher/pipeline/stress/sig.go
	modified:   libbeat/publisher/testing/connector.go
	modified:   libbeat/tests/integration/framework.go
	modified:   metricbeat/mb/module/runner_group_test.go
	modified:   packetbeat/sniffer/sniffer.go
	modified:   winlogbeat/beater/acker.go
	modified:   winlogbeat/sys/wineventlog/renderer_test.go
	modified:   x-pack/filebeat/input/awss3/metrics_test.go
	modified:   x-pack/filebeat/input/entityanalytics/internal/kvstore/tracker.go
	modified:   x-pack/filebeat/input/entityanalytics/internal/kvstore/tracker_test.go
	modified:   x-pack/filebeat/input/entityanalytics/internal/kvstore/transaction.go
	modified:   x-pack/filebeat/input/gcppubsub/pubsub_test.go
	deleted:    x-pack/filebeat/input/netflow/decoder/atomic/bool.go
	modified:   x-pack/filebeat/input/netflow/decoder/v9/session.go
	modified:   x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer.go
	modified:   x-pack/metricbeat/module/cloudfoundry/v1.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   filebeat/inputsource/common/streaming/listener.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot requested review from belimawr and khushijain21 and removed request for a team December 10, 2024 22:10
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 10, 2024
@mergify mergify bot requested review from michalpristas and swiatekm and removed request for a team December 10, 2024 22:10
@botelastic
Copy link

botelastic bot commented Dec 10, 2024

This pull request doesn't have a Team:<team> label.

@kruskall kruskall removed the conflicts There is a conflict in the backported pull request label Dec 10, 2024
@mergify
Copy link
Contributor Author

mergify bot commented Dec 16, 2024

This pull request has not been merged yet. Could you please review and merge it @kruskall? 🙏

1 similar comment
@mergify
Copy link
Contributor Author

mergify bot commented Dec 23, 2024

This pull request has not been merged yet. Could you please review and merge it @kruskall? 🙏

@andrzej-stencel andrzej-stencel merged commit 0a33f2a into 8.x Dec 24, 2024
141 checks passed
@andrzej-stencel andrzej-stencel deleted the mergify/bp/8.x/pr-40132 branch December 24, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants