Commit graph

1649 commits

Author SHA1 Message Date
Armin
a8c3d0e50b MINOR: Fix a few more compiler warnings
Fixes #8137
2017-09-05 17:13:05 +00:00
Guy Boertje
456f3c30f0 until dev_utils spec_helper is changed to new method name, alias it.
Fixes #8117
2017-09-01 05:54:16 +00:00
Guy Boertje
3ce46f5473 Really fix verbose logging in tests
Fixes #8117
2017-09-01 05:54:16 +00:00
Colin Surprenant
21dbde2567 fixes for Windows platform tests/specs
use rm_rf to delete dir and shutdown pipeline after run

avoid the use of rescue nil, bad practice

do not mock close as it prevents closing the file an prevents removing it on Windows

cleanup temporary files and relax file name check for Windows

fix paths handling for Windows

flag the read file string as UTF-8 which is what we expect

fix Windows issues

ignore load_average on windows

windows safe URI

cleanup and fix file handling for windows

wait for pipeline shutdown to complete

revert to original puts

cleanups

use environment for windows platform check

fix hash path

wait for pipeline thread to complete after shutdown
2017-08-31 19:42:49 -04:00
Colin Surprenant
825da10cbb wait for pipeline thread to end before returning from the stop action 2017-08-31 19:28:01 -04:00
Armin
187dc467f5 PERFORMANCE: Much faster ConvertedMap
* Use IdentityHashMap since we intern all possible keys anyways and can look them up more efficiently than `String.intern()` from our PathCache
* Use the PathCache to never have to instantiate new `String` when converting a RubyHash

Fixes #8104
2017-08-30 16:55:49 +00:00
Armin
44c61eaa12 MINOR: Cleanup Valuefier to have the same efficient approach that is already used by BiValues
Fixes #8103
2017-08-30 12:29:28 +00:00
Armin
61982bcc5b MINOR: Use more optimal loop in draining QUeue
Fixes #8101
2017-08-30 07:39:42 +00:00
Guy Boertje
2fc04c9edd remove the unneeded require "logstash/util" call, has great expectations that cannot be met if required too early.
fixes #8096

Fixes #8097
2017-08-30 07:09:41 +00:00
Armin
a15116c96c #7712 & #7945 BiValue Improvements
* Turn Enum into HashMap for direct lookup
* Use stateless Lambdas instead of named classes as converter functions for better performance
* Remove redundant instanceof checks by splitting existing converter functions between Java and Ruby version
* Use most restrictive instanceof check possible for Ruby converters for performance improvements

Fixes #8087
2017-08-29 19:21:43 +00:00
Armin
69fc14f765 PERFORMANCE: Move Memory Queue Drain Loop to Java fully
Fixes #8083
2017-08-29 13:08:15 +00:00
Jake Landis
71fa64bf9c Metrics / Bug Fix: Protect against race condition in metrics reporting with multiple inputs.
Protect initialization of metrics obejcts with  mutex to prevent race condition. See https://github.com/elastic/logstash/issues/8011 for additional information.

Fixes #8011

Fixes #8027

Fixes #8047
2017-08-28 21:51:15 +00:00
Guy Boertje
c5f56e84d8 Modules cloud id auth (#8059)
* add newlines to generated json

* Implement cloud.id and cloud.auth settings merge to module settings

* Fixes from review plus convert to using Password for any Module Setting

* Review changes

* update modules.asciidoc to include a section on Cloud

* Capitalize Id

* remove unnecessesary require lines
2017-08-28 08:46:02 -07:00
Armin
fec6288a41 MINOR: Cleanup magic string for LS JRuby Module name
Fixes #8084
2017-08-28 14:48:26 +00:00
Armin
a3aefe9519 MINOR: Fix a lot of new compiler warnings in Metrics code
Fixes #8086
2017-08-28 14:20:41 +00:00
Rob Bavey
75028f3592 Fix DLQ support for multi-pipelines
Add missing settings to the multi-pipeline settings white list to
allow DLQ to be used with multi-pipelines

Fixes #8069

Fixes #8076
2017-08-25 20:34:19 +00:00
Colin Surprenant
f64762fd05 relax time gap constrain in expectation 2017-08-25 13:11:38 -04:00
Jake Landis
956b6db3d4 Metrics: move Witness class to better package names
Part of #7788

Fixes #8065
2017-08-24 20:25:23 +00:00
Jake Landis
976e918d21 Fix path for local development (attempt 2)
With IntelliJ 2017.02 the gradle output changed from 'build/classes' to 'out/production/classes'. See https://youtrack.jetbrains.com/issue/IDEA-175172 for additional information.

This PR changes the local developement behavior to prefer the classes build with IntelliJ (if they exist) over the classes built directly with gradle.

Fixes #8056
2017-08-23 22:35:22 +00:00
Andrew Cholakian
3b26440131 Use rspec wait to fix flakey converge specs
Some converge specs have races, assuming that a running Agent means that pipelines have started running.
This patch lets us wait a while in the event of a race. One such failure is here: https://logstash-ci.elastic.co/job/elastic+logstash+master+multijob-unix-compatibility/os=centos/72/console

Additionally, this removes a harmless double invocation in these specs

Fixes #7912
2017-08-23 21:56:48 +00:00
Jake Landis
166ac8b2bd Metrics: Add custom witness for plugins, and code clean up
Remove LongGauge and DoubleGauge and Replace with NumberGauge
 - This is an unecessary distiction for Gauges and can complicate the serialization. Double/Float should serialize with decimal precision, and Jackson handles this by default.

Add custom witness to match existing Ruby API, such that existing Ruby plugins should not need changes

Remove namespace from LazyDelegatingGauge
 - It was only there for logging, but newer versions (not here) will completely remove the concept of namespace.

Part of #7788

Fixes #8053
2017-08-23 17:09:01 +00:00
Jake Landis
9f65f183d1 Metrics: More consistent serialization, Witness support for DLQ, PQ, and Java clean up
* Additional consistent serialization (don't check for null value, continuation of https://github.com/elastic/logstash/pull/8009 / 5d83a71aa4)
* Add support for Dead Letter Queue
* Add support for persitent Queue
* Scope clean up

Part of #7788

Fixes #8023
2017-08-22 15:52:25 +00:00
Rob Bavey
32b16bfaa4 Moved test from RecordIOWriterTest to RecordIOReaderTest
Moved testReadWhileWriteAcrossBoundary to RecordIOReader as it verifies a fix in the
 RecordIOReader class

Fixes #8024
2017-08-18 19:15:04 +00:00
Rob Bavey
e276582d8c DLQ: Fix reading while writing boundary issues
Fixes an issue where if the DLQ is actively being read and written to, the consumeBlock method would
write data to the position where the data was last read from, rather than written to, leading to
plugin crashes.

Fixes #8024
2017-08-18 19:15:04 +00:00
Jake Landis
5d83a71aa4 Metrics: Consistent serialization
This change allows for the serialized output of the metrics to be consistent w/r/t the un-initialized values. Note - the code presented here is not the current code in use, rather it is the code staged, but unused to replace the metrics store / namespace implementation.

Fixes #7885 (for a future release)

Fixes #8009
2017-08-17 23:35:50 +00:00
Armin
73c1d01722 Performance: Remove BooleanBiValue
Fixes #8015
2017-08-17 17:04:42 +00:00
Armin
4387c959b0 #8016 remove Max bucket setting from specs to bring them in line with #8010
Fixes #8017
2017-08-17 15:07:14 +00:00
Suyog Rao
eaee1e9289 Remove metrics max bucket setting (#8010)
PR #7451 introduced a way to set metrics max bucket settign in Kibana. This ain't good because
it can destabilize Kibana and ES as well
2017-08-16 16:17:25 -07:00
Jake Landis
3c5d7be7ef Metrics: Add Jackson serialization to the Witness classes.
Part of #7788

Fixes #7984
2017-08-16 22:22:48 +00:00
Armin
f06e859717 #7998 Serialization benchmark and Afterburner removal
Fixes #8002
2017-08-16 16:08:09 +00:00
Armin
b30500ab0c MINOR: Cleanup dead IO code
Fixes #7953
2017-08-16 08:57:17 +00:00
Armin
492cae9808 BUG: Fix RubyTimestamp not being serialized correctly
Fixes #7996
2017-08-15 13:39:44 +00:00
Andrew Cholakian
0b03e2f873 Revert "create source_loader after logging setup"
This commit broke the plugin contract with plugins like xpack and caused many issues there. Reverted until it can be better handled.

This reverts commit 92cdbe2dbd.

Fixes #7995
2017-08-14 23:11:32 +00:00
Rob Bavey
8da0737252 DeadLetterQueueReader should handle missing segment files at startup
Change DeadLetterQueueReader, so that if a missing segment file is
encountered at startup, the next valid entry will be used instead

Fixes #7433

Fixes #7457
2017-08-14 20:07:26 +00:00
Armin
240048b88d #7990 bring back batch acking for PQ
Fixes #7991
2017-08-14 17:35:11 +00:00
Jake Landis
23f6d3972e Metrics: Witness data model
The role of Witness is to provide an API record state of what is happening inside of Logstash, and provide means to serialize the data for consumption (not included in the commit). The Witness is implemented by chaining methods with a singleton root. For example:

Witness.instance().pipeline("main").inputs("foo").events().in(1)

Can be used to express that for the foo input in the main pipeline, 1 new event has been seen.

Witnesses may also have a snitch method, which allows the witness to snitch (tell others) the discrete values of the metrics. A snitch method is basically the getter. For example:

Witness.instance().pipeline("main").inputs("foo").events().snitch().in()

Tells you you how many events have been witnessed for the foo input in the main pipeline. In practice this the snitch is really only used for testing, but may be useful as just a standard set/get type operations. Serialization to JSON (not included in this commit) is the primary means to get data out of a Witness.

Some workflows require that a Witness forgets what it saw, for example during a pipeline reload. In these cases the Witness may completely or partially forget the data they have seen. This is implemented with a forget method. For example:

Witness.instance().pipeline("main").inputs("foo").events().forget().all();

Fixes #7947
2017-08-11 19:18:04 +00:00
Rob Bavey
b231036f87 Remove redundant null check from DeadLetterQueueReader
Fixes #7948
2017-08-11 18:35:49 +00:00
Rob Bavey
edbb1e021f Tidy up BufferState internal class
Fixes #7948
2017-08-11 18:35:49 +00:00
Rob Bavey
bbe0005792 DLQ: Multiple bug fixes related to event seeks
The fixes in this commit combine to fix #7855

Fixes 3 bugs:
  seekToNextEventPosition:
    handles the case where a null event is encountered during the search for a matching event
    handle restoration of buffer position when the next event consumed goes across block
     boundaries

  seekToStartOfEventInBlock:
    handles the case where the only event in a block is an 'end' event

Also:
 Adds new RecordIOReaderTest, and moves tests over from RecordIOWriterTest that seem to fit
that better

Fixes #7948
2017-08-11 18:35:49 +00:00
Joao Duarte
92cdbe2dbd create source_loader after logging setup
Fixes #7970
2017-08-11 13:18:32 +00:00
Joao Duarte
e28ceeb8e5 prevent tests from changing config.debug flag
Fixes #7962
2017-08-10 08:13:31 +00:00
Aaron Mildenstein
fb7f455f1c Add --setup phase for modules (#7965)
* Add --setup phase for modules

Without the `--setup` flag, the index template for elasticsearch, and the index-pattern, saved searches, visualizations, and dashboards for Kibana will not be published.

fixes #7959
2017-08-09 16:50:56 -06:00
Suyog Rao
203d419762 Add log statement about modules that are run
Fixes #7963
2017-08-09 21:48:11 +00:00
Andrew Cholakian
9f1830d119 Generate codec IDs randomly
Fixes #7930
2017-08-09 15:42:12 +00:00
Andrew Cholakian
0e7cba783e Use LIR to generate vertex plugin IDs
In this patch we unify the IDs reported by LIR with those generated using config_ast.rb

This is a temporary fix until LIR execution is built. It relies on the fact that currently both LIR and config_ast.rb only operate on a single concatenated string of configurations. In the future LIR will compile different files separately, then merge their IRs. For now, however, this solution will hold.

This change also exposes the :id attribute of FilterDelegator to bring it to parity with OutputDelegator and InputDelegator which is required for testing purposes.

Fixes #7930
2017-08-09 15:42:12 +00:00
Armin
10cda63f1d Test Stability: Fix Global Ruby Runtime Setup
Fixes #7957
2017-08-09 15:26:30 +00:00
Joao Duarte
7c514689bb fix debug logging messages with thread values
Fixes #7954
2017-08-09 14:27:32 +00:00
Joao Duarte
01110a9b48 cleanup force shutdown code
Fixes #7955
2017-08-09 14:25:47 +00:00
Armin
f6aa7e82b3 MINOR: Cleanup Event serialization and fix related compiler warnings
Fixes #7922
2017-08-09 11:20:11 +00:00
Joao Duarte
79ca3b9996 force exit on double SIGINT
Fixes #7918
2017-08-09 08:29:36 +00:00