Commit graph

1123 commits

Author SHA1 Message Date
Joao Duarte
e1fc7f7e4b avoid clashes between Environment class methods
Fixes #10860
2019-06-14 17:44:38 +00:00
Colin Surprenant
640fd80556
fix JRuby resolv.rb leak (#10740) 2019-05-07 16:09:28 -04:00
João Duarte
03fbc85e0c
Update patch plugin versions in gemfile lock (#10678) (#10678) 2019-04-12 15:32:32 +01:00
Dan Hermann
101e60f7c2 Correctly sets the default codec to java_line. Fixes buffer handling for events whose encodings do not fit into the buffer.
Fixes #10673
2019-04-10 18:32:04 +00:00
João Duarte
5d60dc9e8c
prevent DeprecatedRemovedSetting from fatally stopping logstash (#10657) 2019-04-05 12:20:03 +01:00
Dan Hermann
4a27b4c264 Handle duplicate config entries
Fixes #10619
2019-04-04 17:53:44 +00:00
Dan Hermann
6019e6cf05 Log successful shutdowns
Fixes #10628
2019-04-04 08:51:00 +00:00
Ry Biesemeyer
3fc244d40b add DeprecatedSetting to ease 7.0 transition of xpack config renames
Fixes #10623
2019-04-02 22:40:46 +00:00
Rob Bavey
f0006a051e Fix issue setting 'enable_metric => false' on a plugin
This commit fixes a ClassCastException which happens when
 a plugin has the `enable_metric` setting set to false - a
 NullMetricExt is assumed, but that is only created when
 'metric.collect' is set to 'false' in the Logstash configuration,
 not when an individual plugin disables its metrics.

Fixes #10538
2019-03-13 10:43:18 +00:00
Ry Biesemeyer
23a24bff90 prevent concurrent convergence (e.g., SIGHUP during in-flight convergence)
There are several scenarios in which we can trigger concurrent convergence in
the agent, resulting in two or more threads working to perform interleaved and
potentially conflicting or overlapping pipeline actions. Notably, our trap on
`SIGHUP` will be resolved in its own thread, so if we are sent `SIGHUP` while
in the process of converging, the second in-flight convergence may get its
starting state before, during, or after the effects of the first convergence.

By mutually excluding execution of the convergence cycle, we eliminate the
class of bugs in which one convergence acquires actions that cannot succeed due
to the prior success of actions given to the other convergence.

Fixes #10537
2019-03-12 17:37:41 +00:00
Dan Hermann
0910353d71 fix bug with explicitly-specified Java codecs
Fixes #10520
2019-03-08 02:05:57 +00:00
Colin Surprenant
268040c760
remove exclusive lock for Ruby pipeline initialization (#10462)
7.0 clean backport of #10431
2019-02-15 17:34:47 -05:00
Rob Bavey
fd98d0adf7 Mute Failing Test on Windows
Mute mixin_spec, tracked by #10454

Fixes #10455
2019-02-15 19:44:22 +00:00
Dan Hermann
f98794410b One more character encoding fix
Fixes #10452
2019-02-14 21:36:51 +00:00
Dan Hermann
1aff1c93fe fix Stdin tests to work on platforms that do not have UTF-8 as the default character encoding
Fixes #10449
2019-02-14 16:56:06 +00:00
Dan Hermann
3301233ee8 Fix line codec tests so they work on platforms such as Windows that do not have UTF-8 as the default character encoding
Fixes #10446
2019-02-14 14:47:56 +00:00
Ry Biesemeyer
13b84a1270 ast/lir: simplify concurrent use of AST, which is globally stateful
Fixes #10415
2019-02-09 00:24:46 +00:00
Rob Bavey
f3917efcb8 Remove unnecessary option to not require host in SafeURI
Fixes #10414
2019-02-08 14:14:33 +00:00
Rob Bavey
ef8bbefcf1 Better handle malformed URIs
Raise an error if a URI has inadvertently been supplied without a host

Fixes #10414
2019-02-08 14:14:33 +00:00
Ry Biesemeyer
104a02cf96 keystore: instances of CharsetEncoder are stateful and cannot be shared
Fixes a crash that occurs on pipeline load and/or reload when using both the
java keystore and the multi-pipeline feature, when more than one pipeline
references `${}`-style variables.

Fixes #10408
2019-02-06 22:17:52 +00:00
Joao Duarte
2910faa57f fix building of deb and rpm
fpm requires json 1.x but the artifact rake tasks
will activate the default gem json 2

This PR ensures json 1 is activated early and is present right after
jruby is bootstrapped.

Also downgrades fpm to 1.3 as 1.11.0 wasn't building correctly

Downgrades .ruby-version to a version we have available in CI

Fixes #10396
2019-02-06 09:39:55 +00:00
Ry Biesemeyer
937200d70d agent webserver: synchronise control
if we send `Agent#stop_webserver` while `Agent#start_webserver` is
executing, we risk the `@webserver_thread` being nil and getting a
`NoMethodError`.

Fixes #10393
2019-02-06 07:47:59 +00:00
João Duarte
8d19e6cef9
Cleanup dependencies (#10171)
* cleanup Gemfile.template dependencies
* cleanup logstash-core gem dependencies
2019-02-05 16:38:49 +00:00
Ry Biesemeyer
9e886a9682
tests: support more-precise clocks in Java 11 (#10381) 2019-02-05 08:08:49 -08:00
Ry Biesemeyer
583ec6b625
Java 11 support (#10279)
* bump jruby to 9.2

* don't rely on logstash-base docker image

* work around webmock ruby 2.5 support

* ensure data folder exists in docker

* change fixnum and bignum to integer

* FileUtils.rmdir to rm_rf

this is because from 2.3 to 2.5 FileUtils.rmdir will throw an exception
if the directory isn't empty. On 2.3 the operation will just not delete
the directory silently.

* bump jruby to 9.2.5.0 and fix test

* make rake default task since prepare pack needs it

* Resolve compiler warnings (#10247)

There are 3 types of compiler warnings that are either resolved or suppressed:

1. Rawtypes: In JRuby 9.2, `RubyArray` is a generic, so references throughout
   our codebase to the now "raw" type trigger warnings. In most cases we cannot
   actually resolve the issue, since the JRuby-provided methods for creating
   `RubyArray`s still return the raw type, so these have been suppressed.

2. Deprecations:
   - `RubyString#intern19()` -> `RubyString#intern()`
   - `RubyString#downcase19(ThreadContext)` -> `RubyString#downcase(ThreadContext)`
   - `NativeException`: remove import & reference directly; suppress usage
     warnings
   - `RaiseException()`: migrate to equivalent non-deprecated methods wherever
     possible; in some cases where we are using this in conjunction with the
     also-deprecated `NativeException` to preserve java stacktraces, there
     seems to be no non-deprecated path forward, so these cases have been
     suppressed.

3. Redundant Casts
   - Resolved

* JRuby 9.2 bundler shenanigans (#10266)

* Revert "Revert "remove forced dependency on old bundler (#9395)""

This reverts commit bef984143d.

* plugin management: update internal bundler to 1.17.x APIs

* deps: update dev dependency webmock to version compatible with JRuby 9.2

* spec: update Pack fixture to include manticore version that doesn't conflict

* build: update gradle to version that has Java 11 support

* java11: resolve or suppress deprecation warnings

* Remove superfluous flag opting into ParNew GC implementation

When opting into CMS garbage collector with `XX:+UseConcMarkSweepGC`, the
young generation collector ParNew has been the default since Java 8, making
the `XX:+UseParNew` flag redundant; the flag was removed in Java 9, and
should no longer be specified to work with modern Javas.

https://bugs.openjdk.java.net/browse/JDK-8006478
https://openjdk.java.net/jeps/214

* spec: set thread name to example description for easier debugging

* spec: prevent errors in testing specs by checking against skip list before using

* no-op: remove use of `HashMap#computeIfAbsent` on single-threaded code

> This method will, on a best-effort basis, throw a `ConcurrentModificationException`
> if it is detected that the mapping function modifies this map during computation.
>
> -- https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html#computeIfAbsent(K,java.util.function.Function)

* qa: by default, run integration against Elastic Stack 6.5.x

To support development on Logstash on top of Java 11, default to testing
against an Elastic Stack that is capable of running on Java 11.

* qa: ignore deprecation warnings when comparing offline pack output

* qa: add Java 9+ support to ChildProcess dev dependency

this can safely be removed when the childprocess gem supports Java9+
https://github.com/enkessler/childprocess/pull/141

* qa: allow connections to localhost in webmock

* bump jrjackson version

* fix filebeat integration tests

* spec: ensure license compliance spec runs first

The license compliance spec that validates the licenses of bundled
plugins appears to not be compatible with the hooks that we inject
into bundler for plugin management, and will fail in obscure ways
when run after those hooks have been added. Since those hooks are
not necessary for validating licenses, the easiest solution was to
ensure that those specs run first, before the VM has been poluted.

Since the gradle/junit/rspec bridge that is currently in place
runs all specs in the same JVM, we also need to make sure that the
rspec "world" is reset before a run, to ensure that it doesn't
retain spec definitions from previous runs.

Also updates the rake invocation, although I'm not sure it is used
any more.
2019-02-04 16:36:11 -08:00
Dan Hermann
48ee9987cc
Native support for Java plugins (beta) (#10232) 2019-02-04 11:36:36 -06:00
Colin Surprenant
f08b8c5076
fix agent silent exit upon pipelines reloading (#10346) 2019-01-31 15:48:50 -05:00
João Duarte
25e773556c
remove pipeline output workers setting (#10358) 2019-01-30 10:09:15 +00:00
Dan Hermann
e6d59de458
Update java dependencies (#10340) 2019-01-18 08:16:13 -06:00
Colin Surprenant
528112c67e
correctly handle pipeline actions (#10331) 2019-01-16 14:42:26 -05:00
Colin Surprenant
5591ee7d79 properly set thread name in thread context 2019-01-09 18:12:04 -05:00
Dan Hermann
5701c84b21 Catch only specific exceptions
Fixes #10250
2019-01-04 13:43:37 +00:00
Dan Hermann
9288515b2b Add documentation for java-execution flag and remove any references to beta status
Fixes #10248
2019-01-04 02:48:44 +00:00
Dan Hermann
19554259b8 add option for PQ checkpoint retry
Fixes #10234
2019-01-02 21:15:38 +00:00
Dan Hermann
2a45a8fd9d
Resolve javadoc warnings not seen on 1.8.0_181 (#10244) 2019-01-02 13:46:50 -06:00
Dan Hermann
76a1d0a664
Eliminate compiler and javadoc warnings (#10241) 2019-01-02 07:16:19 -06:00
Dan Hermann
4152f89022 Remove unused code and cleanup javadoc comments
Fixes #10233
2019-01-02 12:40:56 +00:00
Dan Hermann
134818e69e
Remove witness classes (#10240) 2019-01-01 15:03:56 -06:00
Dan Hermann
47e1bd252f Increase default number of threads reported by hot_threads
Fixes #10218
2018-12-18 16:54:12 +00:00
Dan Hermann
69c54bd482 Add list tag for Codec javadoc
Fixes #10219
2018-12-18 14:20:19 +00:00
Dan Hermann
e89501e47e Java plugin API
Fixes #10216
2018-12-18 00:39:59 +00:00
dmitriisilin
d5b5f9a4fc Add Zing JVM to the list of supported garbage collectors.
Fixes #10051
2018-12-10 10:30:43 +00:00
Joao Duarte
e4159d0fb6 setting a list config to empty array should not result in nil
if a plugin author defines a config parameter as:

  config :retryable_codes, :validate => :number, :list => true, :default => [429]

And a user configures the plugin as:

  plugin { retryable_codes => [] }

It's expected that the retryable_codes parameter is an empty array and not a nil object

This PR changes this behaviour to generate an empty array

Fixes #10179
2018-11-27 14:00:26 +00:00
Colin Surprenant
5af825cb62
upgrade rack to version 1.6.11 (#10148) 2018-11-16 13:28:44 -05:00
Dan Hermann
e0a125f3b9 add common base class for generated Dataset classes
Fixes #10136
2018-11-09 19:02:21 +00:00
Dan Hermann
dbf241285e generalize method parameters
Fixes #10133
2018-11-08 22:20:53 +00:00
Dan Hermann
4bdff7a9fc replace for-loop with static method calls
Fixes #10133
2018-11-08 22:20:52 +00:00
Guy Boertje
1f7a369993
Add VERSION_QUALIFIER support for use by release manager (#10117)
* Add VERSION_QUALIFIER support for use by release manager

* Make the gem build processes aware of the version qualifier

* Try debugging xpack ci test failure.

* Try to use the artifacts-api.elastic.co api for ES download.

* It builds/tests locally now.

* add some comments explaining the artifacts-api and the version string

* cahnges requested in review.

Fixes #9956
2018-11-07 22:39:52 +00:00
João Duarte
fe7607abd4
only start monitoring pipeline after valid license (#10106)
Avoid unecessary logging errors and resource usage by only starting
the monitoring pipeline if we can validate the license.
2018-11-07 17:28:48 +00:00
Colin Surprenant
cc2d54bc16
synchronize ruby pipeline initialization to fix concurrency bug (#10113) 2018-11-02 19:19:31 -04:00