Skip to content

Commit e9dbb31

Browse files
authored
Merge branch '8.19' into backport/8.19/pr-10156
2 parents 8494b11 + 11b8f0c commit e9dbb31

13 files changed

Lines changed: 380 additions & 24 deletions

File tree

.buildkite/scripts/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ disable_background_package_managers() {
4242
return 0
4343
fi
4444
echo "Disabling background package managers to prevent RPM lock contention"
45-
for unit in dnf-makecache.timer dnf-makecache.service packagekit.service; do
45+
for unit in dnf-automatic.timer dnf-makecache.timer dnf-makecache.service packagekit.service; do
4646
sudo systemctl disable --now "$unit" 2>/dev/null || true
4747
done
4848
}

.github/workflows/bump-agent-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: ./.github/workflows/bump-agent-versions.sh
4545

4646
- if: ${{ failure() }}
47-
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
47+
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
4848
with:
4949
method: chat.postMessage
5050
token: ${{ secrets.SLACK_BOT_TOKEN }}
@@ -67,7 +67,7 @@ jobs:
6767

6868
# if a PR was created as a result of this job, we notify on the Slack channel
6969
- if: ${{ startsWith(steps.update.outputs.pr, 'https') }}
70-
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
70+
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
7171
with:
7272
method: chat.postMessage
7373
token: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/serverless-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
####################################
2424
- name: Get token
2525
id: get_token
26-
uses: actions/create-github-app-token@v2
26+
uses: actions/create-github-app-token@v3
2727
with:
2828
app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
2929
private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}

.package-version

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"version": "8.19.13-SNAPSHOT",
3-
"build_id": "8.19.13-dd251cf2",
4-
"manifest_url": "https://snapshots.elastic.co/8.19.13-dd251cf2/manifest-8.19.13-SNAPSHOT.json",
5-
"summary_url": "https://snapshots.elastic.co/8.19.13-dd251cf2/summary-8.19.13-SNAPSHOT.html",
3+
"build_id": "8.19.13-e6e561a2",
4+
"manifest_url": "https://snapshots.elastic.co/8.19.13-e6e561a2/manifest-8.19.13-SNAPSHOT.json",
5+
"summary_url": "https://snapshots.elastic.co/8.19.13-e6e561a2/summary-8.19.13-SNAPSHOT.html",
66
"core_version": "8.19.13",
77
"stack_version": "8.19.13-SNAPSHOT",
8-
"stack_build_id": "8.19.13-dd251cf2-SNAPSHOT"
8+
"stack_build_id": "8.19.13-e6e561a2-SNAPSHOT"
99
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# REQUIRED
2+
# Kind can be one of:
3+
# - breaking-change: a change to previously-documented behavior
4+
# - deprecation: functionality that is being removed in a later release
5+
# - bug-fix: fixes a problem in a previous version
6+
# - enhancement: extends functionality but does not break or fix existing behavior
7+
# - feature: new functionality
8+
# - known-issue: problems that we are aware of in a given version
9+
# - security: impacts on the security of a product or a user’s deployment.
10+
# - upgrade: important information for someone upgrading from a prior version
11+
# - other: does not fit into any of the other categories
12+
kind: bug-fix
13+
14+
# REQUIRED for all kinds
15+
# Change summary; a 80ish characters long description of the change.
16+
summary: Fix an issue where some components could be missing from the status output
17+
18+
# REQUIRED for breaking-change, deprecation, known-issue
19+
# Long description; in case the summary is not enough to describe the change
20+
# this field accommodate a description without length limits.
21+
description: >
22+
In some cases, a late update from an older component instance could overwrite a newer state.
23+
This could cause components to be missing from the status output.
24+
With this fix, updates from older instances are ignored if a newer update has already been processed.
25+
26+
# REQUIRED for breaking-change, deprecation, known-issue
27+
# impact:
28+
29+
# REQUIRED for breaking-change, deprecation, known-issue
30+
# action:
31+
32+
# REQUIRED for all kinds
33+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
34+
component: elastic-agent
35+
36+
# AUTOMATED
37+
# OPTIONAL to manually add other PR URLs
38+
# PR URL: A link the PR that added the changeset.
39+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
40+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
41+
# Please provide it if you are adding a fragment for a different PR.
42+
# pr: https://github.com/owner/repo/1234
43+
44+
# AUTOMATED
45+
# OPTIONAL to manually add other issue URLs
46+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
47+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
48+
# issue: https://github.com/owner/repo/1234
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: bug_fix
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Fix the elastic-agent build time as reported by the version command
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: elastic-agent
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

dev-tools/mage/settings.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"runtime"
1818
"strconv"
1919
"strings"
20+
"time"
2021

2122
"github.com/magefile/mage/sh"
2223
"golang.org/x/text/cases"
@@ -75,7 +76,7 @@ func FuncMap(cfg *Settings) map[string]interface{} {
7576
"beat_version": func() string { return cfg.BeatQualifiedVersion() },
7677
"commit": func() (string, error) { return cfg.Build.CommitHash() },
7778
"commit_short": func() (string, error) { return cfg.Build.CommitHashShort() },
78-
"date": func() string { return cfg.BuildDate },
79+
"date": func() string { return cfg.BuildDateString() },
7980
"elastic_beats_dir": func() string { return cfg.ElasticBeatsDir },
8081
"go_version": func() string { return cfg.GoVersion() },
8182
"repo": func() *ProjectRepoInfo { return cfg.RepoInfo },
@@ -647,7 +648,7 @@ type Settings struct {
647648

648649
// BuildDate is the timestamp when settings were loaded (build started).
649650
// Initialized during LoadSettings().
650-
BuildDate string
651+
BuildDate time.Time
651652
}
652653

653654
// DefaultSettings returns a new Settings instance with all default values.
@@ -679,6 +680,7 @@ func (s *Settings) setBuildDefaults() {
679680
s.Build.GOOS = build.Default.GOOS
680681
s.Build.GOARCH = build.Default.GOARCH
681682
s.Build.MaxParallel = runtime.NumCPU()
683+
s.BuildDate = time.Now().UTC()
682684
}
683685

684686
// setBeatDefaults sets default values for BeatSettings.
@@ -1735,6 +1737,11 @@ func (s *Settings) BeatVersion() string {
17351737
return s.beatVersion
17361738
}
17371739

1740+
// BuildDateString returns a formatted build date.
1741+
func (s *Settings) BuildDateString() string {
1742+
return s.BuildDate.Format(time.RFC3339)
1743+
}
1744+
17381745
// GetPlatforms returns the parsed platform list from PLATFORMS env var.
17391746
// If PLATFORMS is empty, returns the default platform list.
17401747
// Platform filters from the settings' PlatformFilters are applied to the result.

dev-tools/mage/settings_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ func TestDefaultSettings(t *testing.T) {
602602
assert.False(t, settings.Build.Snapshot)
603603
assert.False(t, settings.Build.DevBuild)
604604
assert.Greater(t, settings.Build.MaxParallel, 0)
605+
assert.NotZero(t, settings.BuildDate)
605606

606607
// Dev machine defaults
607608
assert.Equal(t, DefaultDevMachineImage, settings.DevMachine.MachineImage)

internal/pkg/agent/application/coordinator/coordinator_state.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,21 @@ func (c *Coordinator) applyComponentState(state runtime.ComponentComponentState)
154154
// check for any component updates to the known PID, so we can update the component monitoring
155155
found := false
156156
for i, other := range c.state.Components {
157-
if other.Component.ID == state.Component.ID {
158-
if other.State.Pid != state.State.Pid {
159-
c.componentPidRequiresUpdate.Store(true)
160-
}
161-
c.state.Components[i] = state
162-
found = true
163-
break
157+
if other.Component.ID != state.Component.ID {
158+
continue
159+
}
160+
// We want to update the component state if the incoming update is from the same instance or a newer instance of the component.
161+
// We determine this by comparing start times, since a newer instance would have a later start time.
162+
if other.Component.LastConfiguredAt.After(state.Component.LastConfiguredAt) {
163+
// This is a case where a component has transitioned to a new state but we receive a late update from the older component.
164+
return
165+
}
166+
if other.State.Pid != state.State.Pid {
167+
c.componentPidRequiresUpdate.Store(true)
164168
}
169+
c.state.Components[i] = state
170+
found = true
171+
break
165172
}
166173
if !found {
167174
c.state.Components = append(c.state.Components, state)

0 commit comments

Comments
 (0)