Commit c3dc166
**Which issue(s) this PR fixes**:
Backport #5451
Fixes #
**What this PR does / why we need it**:
On Windows, Hyper-V/WinNAT/HNS take their reservations from the dynamic
port range, which is 49152-65535 as observed on GitHub Actions runners,
and a reservation can appear between the check and the actual bind.
When searching for unused ports, this PR will avoid this range to
prevent following error.
```
3) Error: test: send_with_time_as_integer(ForwardOutputTest): Errno::EACCES: Permission denied - bind(2) for 127.0.0.1:58707
C:/hostedtoolcache/windows/Ruby/4.0.5/arm64/lib/ruby/4.0.0/socket.rb:183:in 'Socket#bind'
C:/hostedtoolcache/windows/Ruby/4.0.5/arm64/lib/ruby/4.0.0/socket.rb:183:in 'Addrinfo#bind'
C:/a/fluentd/fluentd/lib/fluent/plugin_helper/server.rb:402:in 'Fluent::PluginHelper::Server#server_create_udp_socket'
C:/a/fluentd/fluentd/lib/fluent/plugin_helper/server.rb:178:in 'Fluent::PluginHelper::Server#server_create'
C:/a/fluentd/fluentd/lib/fluent/plugin/in_forward.rb:192:in 'Fluent::Plugin::ForwardInput#start'
C:/a/fluentd/fluentd/lib/fluent/test/driver/base.rb:120:in 'Fluent::Test::Driver::Base#instance_start'
C:/a/fluentd/fluentd/lib/fluent/test/driver/base.rb:78:in 'Fluent::Test::Driver::Base#run'
C:/a/fluentd/fluentd/lib/fluent/test/driver/base_owner.rb:130:in 'Fluent::Test::Driver::BaseOwner#run'
C:/a/fluentd/fluentd/test/plugin/test_out_forward.rb:516:in 'block (2 levels) in <class:ForwardOutputTest>'
C:/hostedtoolcache/windows/Ruby/4.0.5/arm64/lib/ruby/gems/4.0.0/gems/test-unit-rr-1.0.5/lib/test/unit/rr.rb:98:in 'Test::Unit::RR::Adapter#assert_rr'
C:/a/fluentd/fluentd/test/plugin/test_out_forward.rb:515:in 'block in <class:ForwardOutputTest>'
```
https://github.com/fluent/fluentd/actions/runs/29884012909/job/88810722450#step:6:5337
Related to #5434
**Docs Changes**:
N/A
**Release Note**:
N/A
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shizuo Fujita <fujita@clear-code.com>
1 parent 82f26a9 commit c3dc166
2 files changed
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
95 | | - | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
109 | 119 | | |
110 | 120 | | |
111 | | - | |
| 121 | + | |
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
| |||
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
120 | | - | |
| 130 | + | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
0 commit comments