Skip to content

Commit

Permalink
Fix panic due to unaligned atomic uint64 access (elastic#6148)
Browse files Browse the repository at this point in the history
There was a bug impacting 32-bit platforms where an atomic.Uint64
was not aligned to a 64 bit boundary, causing the log prospector
to panic on startup.

Instead of reordering the field to the start of the struct to guarantee
alignment, which is brittle, this patch just changes the harvester
limit to be a 32-bit unsigned integer.

Closes elastic#6145
  • Loading branch information
adriansr authored and exekias committed Jan 23, 2018
1 parent 1dcb1d6 commit 40489ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion filebeat/input/log/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type config struct {
Paths []string `config:"paths"`
ScanFrequency time.Duration `config:"scan_frequency" validate:"min=0,nonzero"`
CleanRemoved bool `config:"clean_removed"`
HarvesterLimit uint64 `config:"harvester_limit" validate:"min=0"`
HarvesterLimit uint32 `config:"harvester_limit" validate:"min=0"`
Symlinks bool `config:"symlinks"`
TailFiles bool `config:"tail_files"`
RecursiveGlob bool `config:"recursive_glob.enabled"`
Expand Down
2 changes: 1 addition & 1 deletion filebeat/input/log/prospector.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Prospector struct {
outlet channel.Outleter
stateOutlet channel.Outleter
done chan struct{}
numHarvesters atomic.Uint64
numHarvesters atomic.Uint32
}

// NewProspector instantiates a new Log
Expand Down

0 comments on commit 40489ff

Please sign in to comment.