Skip to content

Commit

Permalink
[Ingest Manager] Prevent closing closed reader (elastic#20214)
Browse files Browse the repository at this point in the history
* prevent closing closed

* changelog
  • Loading branch information
michalpristas authored and melchiormoulin committed Oct 14, 2020
1 parent 6a4d94b commit efdf7f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- Unzip failures on Windows 8/Windows server 2012 {pull}20088[20088]
- Fix failing unit tests on windows {pull}20127[20127]
- Improve GRPC stop to be more relaxed {pull}20118[20118]
- Prevent closing closed reader {pull}20214[20214]

==== New features

Expand Down
8 changes: 0 additions & 8 deletions x-pack/elastic-agent/pkg/agent/application/info/agent_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ func getInfoFromStore(s ioStore) (*persistentAgentInfo, error) {
errors.M(errors.MetaKeyPath, agentConfigFile))
}

if err := reader.Close(); err != nil {
return nil, err
}

configMap, err := cfg.ToMapStr()
if err != nil {
return nil, errors.New(err,
Expand Down Expand Up @@ -137,10 +133,6 @@ func updateAgentInfo(s ioStore, agentInfo *persistentAgentInfo) error {
errors.M(errors.MetaKeyPath, agentConfigFile))
}

if err := reader.Close(); err != nil {
return err
}

configMap := make(map[string]interface{})
if err := cfg.Unpack(&configMap); err != nil {
return errors.New(err, "failed to unpack stored config to map")
Expand Down

0 comments on commit efdf7f1

Please sign in to comment.