Commit graph

1649 commits

Author SHA1 Message Date
Armin
1a2c0c8597 #7053 Refactor Queue Settings Class to Using a Builder Pattern
Fixes #7062
2017-05-18 15:57:43 +00:00
Andrew Cholakian
78f70634ed Refactor API specs to play well with others
This is a big chang, it:

1. Moves API specs out of their special hierarchy
2. Removes the API spec spec_helper
3. Reactivates that stats command spec (that was accidentally not being
run before due to it not having _spec as a suffix

This was required to fix the preceeding commit, where we added a
before(:each) hook to the spec_helper that wasn't being picked up in
some cases due to the existence of two spec helpers and a $LOAD_PATH
that could change.

Fixes #7132
2017-05-18 13:45:27 +00:00
Andrew Cholakian
ff222b668b Clean settings before *and* after spec runs for the runner just in case.
This is a bit belt and suspenders, but I'm out of ideas for #6737 .
Its a bit worrying that the test cleanup may not be working correctly

Fixes #7132
2017-05-18 13:45:27 +00:00
Armin
b6c855a0a6 Added JMH Benchmark Suite + Queue Benchmark
Fixes #7118
2017-05-18 06:31:17 +00:00
Armin
b3c4f343f6 MINOR: Cleanup some inefficient List usage
Fixes #7143
2017-05-18 05:20:19 +00:00
Armin
4863621840 MINOR: Removed dead fields from Event
Fixes #7139
2017-05-17 18:16:28 +00:00
Andrew Cholakian
7e9529fe47 Make test for pipeline flushing more resilient.
Instead of depending on the now deprecated multiline filter we use a
dummy filter that just emits events. This simplifies the test and
dramatically reduces timing issues.

I also increased the max-wait for the timer just in case

Fixes #7024

Fixes #7131
2017-05-17 13:57:13 +00:00
Armin
0c282105eb #7087 Fixed unstable test from premature exit of user defined pipeline
Fixes #7133
2017-05-17 13:09:35 +00:00
Andrew Cholakian
879451c964 Remove `mean' metric type.
The central problem with recording a mean stat is that on a non-realtime
system you can't guarantee that samples were evenly spaced out. A series
of timestamped gauges does a better job. This is what we can do in our
x-pack monitoring extension, but not something we should do in core. The
central difference is that x-pack has Elasticsearch, which can act as a
time series database. I'd prefer not to build a tsdb into logstash. That
would obviously involve a lot of complexity.

Fixes #7094.

Fixes #7105
2017-05-16 17:45:10 +00:00
Armin
66f0b52318 Fix broken Gradle tests
Fixes #7114
2017-05-16 15:59:34 +00:00
Pier-Hugues Pellerin
c9700220bd consistency in naming
Fixes #7103
2017-05-16 14:20:34 +00:00
Pier-Hugues Pellerin
23d0b34b53 Make the test for the write WrappedWriteClient more robust
Instead of using sleep we start two threads and we join them to do the
expectation.

Fixes: #7031 #7032

Fixes #7103
2017-05-16 14:20:33 +00:00
Andrew Cholakian
ab6fd09df4 Fix broken javadoc comments in DLQ code
These broken comments were breaking javadoc generation

Fixes #7108
2017-05-15 21:36:25 +00:00
Andrew Cholakian
c1ac7e9add Pin rack version to avoid ruby2.0 only features
We can't run the latest rack without JRuby 9k unfortunately

Fixes #7110
2017-05-15 21:18:58 +00:00
Armin
9cc830fdf1 Minor: Stop allocating byte[] to compute crc32
Fixes #7058
2017-05-15 20:07:12 +00:00
Armin
d989517f83 Some cleanup in queue java code
Fixes #7047
2017-05-11 21:42:30 +00:00
Armin
0020c4beab #6785 spec for nested case added
Fixes #7072
2017-05-11 18:40:14 +00:00
Armin
83a8603284 6785 interpolate settings after flattening settings hash
Fixes #7072
2017-05-11 18:40:13 +00:00
Armin
6bf4eddaff 6785 test windows style interpolation
Fixes #7072
2017-05-11 18:40:13 +00:00
Armin
9f1d889c27 #6785 Interpolate ENV into settings read from logstash.yml
Fixes #7072
2017-05-11 18:40:13 +00:00
Joao Duarte
d17a77e76d bump version to 6.0.0-alpha2 2017-05-11 18:18:29 +01:00
Andrew Cholakian
623fe51474 Rename Pipeline -> PipelineIR + Fix PipelineIR concatenation
This PR helps enable https://github.com/elastic/logstash/issues/7076

This also fixes a bug where when concatenating pipelines for PipelineIR
the to_s versions of the SourceWithMetadata objects were conjoined
instead of just the `text`.

Fixes #7079
2017-05-11 17:11:47 +00:00
Jordan Sissel
e838cc7abf Skip a flakey test failing since November 2016
The failure:

    Failures:

      1) LogStash::Pipeline defaulting the pipeline workers based on thread safety when there are threadsafe filters only starts multiple filter threads
         Failure/Error: expect(pipeline.worker_threads.size).to eq(worker_thread_count)

           expected: 5
                got: 8

Related issues: #6855, #6245, #6355

Fixes #7071
2017-05-11 09:45:19 +00:00
Joao Duarte
cad59d9304 fix a few racing conditions in the agent_spec
Fixes #7066
2017-05-11 09:17:32 +00:00
Andrew Cholakian
2b4afea696 Add original source metadata to LIR pipeline
This is a temporary change until we have LIR execution. This allows the
LIR Pipeline object to be the only object passed into the ruby Pipeline.
The ruby Pipeline needs the source to parse the file into the legacy AST
format.

Fixes #7055
2017-05-10 17:58:26 +00:00
Andrew Cholakian
804788c7fe Compile multiple sources together into one LIR pipeline
This sets us up to correctly set the protocol / metadata fields for LIR
pipelines and work on the refactor mentioned in https://github.com/elastic/logstash/issues/7054

Fixes #7055
2017-05-10 17:58:25 +00:00
Tal Levy
458910bcb9 Introduce DeadLetterQueue to the Execution Context (#6894)
* Introduce a DeadLetterQueueFactory

DeadLetterQueueFactory is a static class that keeps
a static collection of DeadLetterQueueWriteManagers per
pipeline that has plugins requesting to use it.

* DeadLetterQueue was added as a first-class field in the execution context that input/filter/output plugins can leverage
2017-05-09 14:40:59 -07:00
João Duarte
db2c85c5e9 only auto complete config.string (#6974)
this means the configuration read from path.config (-f) is no longer auto completed with stdin/stdout if the input/output sections are missing. This behaviour will only occur with config.string (-e).
2017-05-09 17:30:16 +01:00
João Duarte
07194b830f make e and f flags mutually exclusive (#6976) 2017-05-09 16:42:32 +01:00
Andrew Cholakian
3658c94e9b Refactor SourceLoader to no longer be a singleton.
This cleans up the code from a design patterns standpoint and makes testing plugins easier since you can just create/destroy agents at will.

Without this change the SOURCE_LOADER singleton's state will become dirty as agents are created/destroyed and be problematic.

Fixes #7048
2017-05-09 00:00:02 +00:00
Pier-Hugues Pellerin
b709eb5c68 Fix when settings set in the pipeline_pq_file_spec bleed into other examples
make sure we clone the LogStash::Settings before mutating it.

Fixes: #6868

Fixes #6981
2017-05-04 17:21:43 +00:00
Pier-Hugues Pellerin
4c3a3ad526 Normalize the Alpha version of Logstash
If you use 6.0.0-alpha1, rubygems will change it to 6.0.0.pre.alpha1,
this commit changes the behavior to normalize the version before saving
it to disk.

Fixes #7008
2017-05-04 17:16:55 +00:00
Armin Braun
68aa662491 #7022 unopened queue was throwing npe
Fixes #7023
2017-05-04 15:59:39 +00:00
Pier-Hugues Pellerin
2b3d494bbe Make the Logstash metric check for the timestamp on reload success more robust
The current implementation of the test was using a mock and an expect
on the internal classes to determine when to start testing on the
metrics. I've rewrote the setup of the test to use the file output instead of using a
instance. I believe the previous code was not completely threadsafe and was causing this error
in the spec. We should really remove any mock of the form expect_any_instance_of`.

Ref: #6935

Fixes #6956
2017-05-04 14:21:06 +00:00
Pier-Hugues Pellerin
a758412499 Replace the class declaration with let statements
Instead of using a concrete class use let statement instead, this make
sure they are reset between run and make the variable available at the
context level.

Fixes #7017
2017-05-04 13:05:24 +00:00
Armin Braun
9f2ce5d164 #6518 rebased and adjusted naming
Fixes #7010
2017-05-04 09:03:26 +00:00
Pier-Hugues Pellerin
7bc91b7ceb Adding guards on the SourceLoader#fetch
When the fetch is call we are aggregating all the pipeline_config from
the different sources, if we encounter duplicates ids we will return a
failure, making the pipeline skip that fetch.

Fixes #6866
2017-05-03 21:45:57 +00:00
Pier-Hugues Pellerin
17b2218565 Allow to ask the registry to get a list of plugin klass of a specific type
This expose some of the internal of the registry to the outside world to
allow other part of the system to retrieves plugins.

This change was motivated by #6851 to retrieve the installed list of
modules.

Fixes #7011
2017-05-03 21:43:57 +00:00
TAC
f5fb4b3f9f Fix missing log4j2.properties file on Windows
fix Issue #6352

On Windows, Logstash can't find log4j2.properties file with above message at startup.
```
Could not find log4j2 configuration at path /LS_HOME/config/log4j2.properties.
```

Fixes #6903
2017-05-03 19:30:42 +00:00
Andrew Cholakian
28e51f5c6a Unify ConfigPart and SourceMeta into SourceWithMetadata
This unifies the two different config classes that represented mainly
the same data. While this does expose a plain java class into ruby
this works fine because ruby only needs to access and set values, not
work with ruby return types.

Fixes #7003

Fixes #7004
2017-05-02 13:31:06 +00:00
Armin Braun
01b4144dfe #4324 streamline behaviour of Timestamp.== and Timestamp.eql?
Fixes #7002
2017-05-02 10:45:27 +00:00
Josh Soref
3344b00404 spelling: successfully
Fixes #6969
2017-04-28 17:38:44 +00:00
Josh Soref
0b8ed01dd1 spelling: implicitly
Fixes #6969
2017-04-28 17:38:44 +00:00
Pier-Hugues Pellerin
926e6b9e59 Keep track of the original response of the pipeline_action's execute
This commit is to provide more information when an action fails and will
allow us hopefully to debug a random failure in the test suite for the
environment variable.

ref: #6978

Fixes #6982
2017-04-27 13:05:59 +00:00
Pier-Hugues Pellerin
3dfdbee515 Fix the lock errors in the LogStash::Runner test
The test was actually starting an agent with pipeline and the runner has
currently no was to stop the agent. This commit make sure we use an
agent mock instead.

Fix: #6931

Fixes #6957
2017-04-27 12:45:29 +00:00
Pier-Hugues Pellerin
251ae7fe0e Make the periodic test converge a bit more robust
This test has been a bit flaky since it relies on an external thread to
trigger, this commit add a bit more time for the trigger to happen and
also add a retry.

Fixes: #6929

Fixes #6945
2017-04-27 12:44:39 +00:00
Andrew Cholakian
0b0d37b1d3 Fix warning about eval being aliased in lscl.rb
This warning was generated due to a java class being used that had its
own `eval` method.

Fixes #6966
2017-04-26 21:24:31 +00:00
Pier-Hugues Pellerin
ab4794375e rename the method to running_user_defined_pipelines instead of user_defined_pipelines
Fixes #6885
2017-04-26 21:07:59 +00:00
Pier-Hugues Pellerin
8ecbdf22b3 expose #user_defined_pipelines so we can use it from an input plugin
Fixes #6885
2017-04-26 21:07:59 +00:00
Pier-Hugues Pellerin
5379065249 adjust the agent and the converge spec for the system pipeline
Fixes #6885
2017-04-26 21:07:59 +00:00