logstash-input-http 4.1.10-java → 4.1.11-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b4ae78b3f16d4cfccb0308ba8b13cc8350cccbe7e5e64aeda8f23d02a5f4381
4
- data.tar.gz: 103a82e45e79fde21327de54a9e3e64c8523729f613b44164d1535d307498fac
3
+ metadata.gz: b4df9b987fe316cf2311ff5ac0ee4220624e8f1b0246a38e63724ee4fdc8ed25
4
+ data.tar.gz: 78b96610ae94ef0ebf9c2a7f879176012bafd87e2e83e97f605afb927b3d288e
5
5
  SHA512:
6
- metadata.gz: de9e960de4e69bd581039a1138fd0edf3ef90c85cf7e6037deb4d38c621b53c30f5f6b56b0dc6e425d7da7a8222e2351320be5f9b3a0fd54cc908f72eb377eea
7
- data.tar.gz: 67e14f699647deaf624d47f6ba409c9cc3abf621f935b84855d0e199b2c7600570df61c3076551d8055ff005df1da26c7591a6cf7c9f57c789e9e27663e52991
6
+ metadata.gz: 58badb2e603db83c166e6d36922de85c97f4521033ed93d5f8792eec94147342b10788bcd9c6f5402f0878543a1c641fad0a7f4efdfea8296cbb65bf0f05dcae
7
+ data.tar.gz: 7c22e4ae98293c7d67122f67e7d8c8ba6ac5bccea7ed70232c4afa56bb8805f39db44f9dc814bd8cc489c6a1dd0db8a29e4860d6b54616e105012d1f1aab1fb4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 4.1.11
2
+ - When configured to use a port that is already in use, the failure is now propagated to the pipeline [#221](https://github.com/logstash-plugins/logstash-input-http/pull/221)
3
+ This fixes an issue where a misconfigured input could retry indefinitely while Logstash's health report continued to report the pipeline as healthy.
4
+
1
5
  ## 4.1.10
2
6
  - Update Netty dependency to 4.1.135.Final [#219](https://github.com/logstash-plugins/logstash-input-http/pull/219)
3
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.10
1
+ 4.1.11
@@ -190,6 +190,13 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
190
190
  require "logstash/inputs/http/message_handler"
191
191
  message_handler = MessageHandler.new(self, @codec, @codecs, @auth_token)
192
192
  @http_server = create_http_server(message_handler)
193
+ begin
194
+ logger.debug("Binding http input to port", :address => "#{@host}:#{@port}", :ssl_enabled => @ssl_enabled)
195
+ @http_server.bind
196
+ rescue java.net.BindException => bind_exception
197
+ @http_server.close rescue nil
198
+ fail LogStash::ConfigurationError, "could not bind to #{@host}:#{@port}; #{bind_exception.message}"
199
+ end
193
200
 
194
201
  @remote_host_target_field ||= ecs_select[disabled: "host", v1: "[host][ip]"]
195
202
  @request_headers_target_field ||= ecs_select[disabled: "headers", v1: "[@metadata][input][http][request][headers]"]
@@ -9,4 +9,4 @@ require_jar('io.netty', 'netty-transport', '4.1.135.Final')
9
9
  require_jar('io.netty', 'netty-buffer', '4.1.135.Final')
10
10
  require_jar('io.netty', 'netty-resolver', '4.1.135.Final')
11
11
  require_jar('io.netty', 'netty-common', '4.1.135.Final')
12
- require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '4.1.10')
12
+ require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '4.1.11')
@@ -8,3 +8,23 @@ end
8
8
  RSpec.configure do |config|
9
9
  config.formatter = :documentation
10
10
  end
11
+
12
+ ##
13
+ # yield the block with a port that is available
14
+ # @return [Integer]: a port that is available
15
+ def find_available_port(host:"::")
16
+ with_bound_port(host: host, &:itself)
17
+ end
18
+
19
+ ##
20
+ # Yields block with a port that is unavailable
21
+ # @yieldparam port [Integer]
22
+ # @yieldreturn [Object]
23
+ # @return [Object]
24
+ def with_bound_port(host:"::", port:0, &block)
25
+ server = TCPServer.new(host, port)
26
+
27
+ return yield(server.local_address.ip_port)
28
+ ensure
29
+ server&.close
30
+ end
@@ -20,17 +20,31 @@ describe LogStash::Inputs::Http do
20
20
  let(:client) { Manticore::Client.new(client_options) }
21
21
  let(:client_options) { { } }
22
22
  let(:logstash_queue) { Queue.new }
23
- let(:port) { rand(5000) + 1025 }
23
+ let(:port) { find_available_port }
24
24
  let(:url) { "http://127.0.0.1:#{port}" }
25
25
 
26
26
  let(:config) { { "port" => port } }
27
27
 
28
- subject { described_class.new(config) }
28
+ subject(:plugin) { described_class.new(config) }
29
29
 
30
30
  it_behaves_like "an interruptible input plugin" do
31
31
  let(:config) { { "port" => port } }
32
32
  end
33
33
 
34
+ context "when port is unavailable" do
35
+ around(:each) do |example|
36
+ with_bound_port(port: port, &example)
37
+ end
38
+
39
+ after(:each) { plugin.stop }
40
+
41
+ it "raises a helpful exception" do
42
+ expect { plugin.register }
43
+ .to raise_error(LogStash::ConfigurationError)
44
+ .with_message(a_string_including("could not bind to #{plugin.host}:#{plugin.port}"))
45
+ end
46
+ end
47
+
34
48
  after :each do
35
49
  client.clear_pending
36
50
  client.close
@@ -594,6 +608,7 @@ describe LogStash::Inputs::Http do
594
608
  context "during run" do
595
609
  let(:http_server) do
596
610
  http_server = double(:http_server)
611
+ allow(http_server).to receive(:bind)
597
612
  allow(http_server).to receive(:close)
598
613
  allow(http_server).to receive(:run)
599
614
  http_server
@@ -643,6 +658,7 @@ describe LogStash::Inputs::Http do
643
658
  context "during run" do
644
659
  let(:http_server) do
645
660
  http_server = double(:http_server)
661
+ allow(http_server).to receive(:bind)
646
662
  allow(http_server).to receive(:close)
647
663
  allow(http_server).to receive(:run)
648
664
  http_server
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.10
4
+ version: 4.1.11
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-06-15 00:00:00.000000000 Z
10
+ date: 2026-07-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: logstash-core-plugin-api
@@ -176,7 +176,7 @@ files:
176
176
  - vendor/jar-dependencies/io/netty/netty-resolver/4.1.135.Final/netty-resolver-4.1.135.Final.jar
177
177
  - vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.135.Final/netty-transport-native-unix-common-4.1.135.Final.jar
178
178
  - vendor/jar-dependencies/io/netty/netty-transport/4.1.135.Final/netty-transport-4.1.135.Final.jar
179
- - vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/4.1.10/logstash-input-http-4.1.10.jar
179
+ - vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/4.1.11/logstash-input-http-4.1.11.jar
180
180
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
181
181
  licenses:
182
182
  - Apache License (2.0)