Alternative to #251 that catches an additional race-condition
Fixes several closely-related race conditions that could cause plugin crashes or data-loss
race condition in initializing a prefix could cause one or more local temp files to be abandoned and only recovered after next pipeline start (replace Concurrent::Map#fetch_or_store with atomicConcurrent::Map#computeIfAbsent)
race condition in stale watcher could cause the plugin to crash when working with a stale (empty) file that had been deleted (mark FileRepository::PrefixedValue as deleted while we have exclusive access to it, and avoid using a marked-deleted FileRepository::PrefixedValue throughout)
race condition in stale watcher could cause a non-empty file to be deleted if bytes were written to it after it was detected as stale (check-and-delete within a single exclusive access, which requires that FileRepository::PrefixedValue#with_lock use reentrant Monitor)
This will need to be forward-ported to the integrated version of this plugin -> logstash-integration-aws
Alternative to #251 that catches an additional race-condition
Concurrent::Map#fetch_or_store
with atomicConcurrent::Map#computeIfAbsent
)FileRepository::PrefixedValue
as deleted while we have exclusive access to it, and avoid using a marked-deletedFileRepository::PrefixedValue
throughout)FileRepository::PrefixedValue#with_lock
use reentrantMonitor
)This will need to be forward-ported to the integrated version of this plugin ->
logstash-integration-aws