Skip to content

Commit dd1a425

Browse files
authored
Merge branch '8.1' into mergify/bp/8.1/pr-29710
2 parents 70bec1b + 0d38d79 commit dd1a425

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

.ci/apm-beats-update.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def beatsUpdate() {
119119
}
120120
dir("${BASE_DIR}"){
121121
git(credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
122-
url: "[email protected]:elastic/${env.REPO}.git")
122+
url: "[email protected]:elastic/${env.REPO}.git",
123+
branch: env.BRANCH_NAME)
123124
sh(label: 'Update Beats script', script: """
124125
git config --global user.email "[email protected]"
125126
git config --global user.name "None"

.ci/packer_cache.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ if [ -x "$(command -v docker)" ]; then
7474

7575
## GitHub api returns up to 100 entries.
7676
## Probably we need a different approach to search the latest minor.
77-
latestMinor=$(curl -s https://api.github.com/repos/elastic/beats/branches\?per_page=100 | jq -r '.[].name' | grep "^7." | tail -1)
77+
latest7Minor=$(curl -s https://api.github.com/repos/elastic/beats/branches\?per_page=100 | jq -r '.[].name' | grep "^7." | tail -1)
78+
latest8Minor=$(curl -s https://api.github.com/repos/elastic/beats/branches\?per_page=100 | jq -r '.[].name' | grep "^8." | tail -1)
7879

79-
for branch in main $latestMinor ; do
80+
for branch in main $latest7Minor $latest8Minor; do
8081
if [ "$branch" != "main" ] ; then
8182
echo "Checkout the branch $branch"
8283
git checkout "$branch"

CHANGELOG.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...main[Check the HEAD dif
4747
*Filebeat*
4848

4949
- tcp/unix input: Stop accepting connections after socket is closed. {pull}29712[29712]
50+
- aws-s3: fix race condition in states used by s3-poller. {issue}30123[30123] {pull}30131[30131]
5051

5152
*Heartbeat*
5253

libbeat/docs/shared-env-vars.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ To specify custom error text, use:
4545
Where `error_text` is custom text that will be prepended to the error
4646
message if the environment variable cannot be expanded.
4747

48-
If you need to use a literal `${` in your configuration file then you can write
49-
`$${` to escape the expansion.
48+
If you need to use a special character in your configuration file, use `$` to escape the expansion. For example, you can escape `${` or `}` with `$${` or `$}`.
5049

5150
After changing the value of an environment variable, you need to restart
5251
{beatname_uc} to pick up the new value.

x-pack/filebeat/input/awss3/states.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const (
2121
)
2222

2323
type listingInfo struct {
24-
totObjects int
24+
totObjects int
25+
26+
mu sync.Mutex
2527
storedObjects int
2628
errorObjects int
2729
finalCheck bool
@@ -105,11 +107,19 @@ func (s *states) Delete(id string) {
105107
func (s *states) IsListingFullyStored(listingID string) bool {
106108
info, _ := s.listingInfo.Load(listingID)
107109
listingInfo := info.(*listingInfo)
110+
listingInfo.mu.Lock()
111+
defer listingInfo.mu.Unlock()
108112
if listingInfo.finalCheck {
109113
return false
110114
}
111115

112116
listingInfo.finalCheck = (listingInfo.storedObjects + listingInfo.errorObjects) == listingInfo.totObjects
117+
118+
if (listingInfo.storedObjects + listingInfo.errorObjects) > listingInfo.totObjects {
119+
s.log.Warnf("unexepected mixmatch between storedObjects (%d), errorObjects (%d) and totObjects (%d)",
120+
listingInfo.storedObjects, listingInfo.errorObjects, listingInfo.totObjects)
121+
}
122+
113123
return listingInfo.finalCheck
114124
}
115125

@@ -154,6 +164,9 @@ func (s *states) Update(newState state, listingID string) {
154164
// here we increase the number of stored object
155165
info, _ := s.listingInfo.Load(listingID)
156166
listingInfo := info.(*listingInfo)
167+
168+
listingInfo.mu.Lock()
169+
157170
if newState.Stored {
158171
listingInfo.storedObjects++
159172
}
@@ -162,6 +175,8 @@ func (s *states) Update(newState state, listingID string) {
162175
listingInfo.errorObjects++
163176
}
164177

178+
listingInfo.mu.Unlock()
179+
165180
if _, ok := s.statesByListingID[listingID]; !ok {
166181
s.statesByListingID[listingID] = make([]state, 0)
167182
}

0 commit comments

Comments
 (0)