Skip to content

Commit 96fa64d

Browse files
[Ingest Manager] Prevent closing closed reader (#20214)
* prevent closing closed * changelog
1 parent 9dc4877 commit 96fa64d

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

x-pack/elastic-agent/CHANGELOG.asciidoc

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
- Unzip failures on Windows 8/Windows server 2012 {pull}20088[20088]
5555
- Fix failing unit tests on windows {pull}20127[20127]
5656
- Improve GRPC stop to be more relaxed {pull}20118[20118]
57+
- Prevent closing closed reader {pull}20214[20214]
5758

5859
==== New features
5960

x-pack/elastic-agent/pkg/agent/application/info/agent_id.go

-8
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ func getInfoFromStore(s ioStore) (*persistentAgentInfo, error) {
9494
errors.M(errors.MetaKeyPath, agentConfigFile))
9595
}
9696

97-
if err := reader.Close(); err != nil {
98-
return nil, err
99-
}
100-
10197
configMap, err := cfg.ToMapStr()
10298
if err != nil {
10399
return nil, errors.New(err,
@@ -137,10 +133,6 @@ func updateAgentInfo(s ioStore, agentInfo *persistentAgentInfo) error {
137133
errors.M(errors.MetaKeyPath, agentConfigFile))
138134
}
139135

140-
if err := reader.Close(); err != nil {
141-
return err
142-
}
143-
144136
configMap := make(map[string]interface{})
145137
if err := cfg.Unpack(&configMap); err != nil {
146138
return errors.New(err, "failed to unpack stored config to map")

0 commit comments

Comments
 (0)