Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on loop because the number of connections keeps increasing #1768

Open
picandocodigo opened this issue Apr 19, 2022 · 1 comment
Open

Comments

@picandocodigo
Copy link
Member

Has anybody had this issue where it continues looping forever because the number of connections keeps increasing?

Error -- 3 -- [Faraday::TimeoutError] request timed out {:id=>"kbnoHraTQN6xu2cgbUTeOQ", :name=>"production-master2", :version=>"5.6.16", :host=>"10.0.11.4", :port=>"9200", :roles=>["master"], :attributes=>nil, :protocol=>"http"}
Warning -- 4 -- [Faraday::TimeoutError] Reloading connections (attempt 1 of 14)
Error -- 3 -- [Faraday::TimeoutError] request timed out {:id=>"VYG1SZilTGuIS_FYOSKTRg", :name=>"production-master1", :version=>"5.6.16", :host=>"10.0.10.52", :port=>"9200", :roles=>["master"], :attributes=>nil, :protocol=>"http"}
Warning -- 4 -- [Faraday::TimeoutError] Reloading connections (attempt 2 of 15)
Fatal -- 1 -- [IRB::Abort] abort then interrupt! ({:id=>"Aei_vKRMQJSm2pK3Xphp2Q", :name=>"production-data-ebs1", :version=>"5.6.16", :host=>"10.0.10.49", :port=>"9200", :roles=>["data", "ingest"], :attributes=>nil, :protocol=>"http"})

1/14
2/15
3/16
etc

It seems dead connections get somehow duplicated of existing alive ones. I can see essentially the same connection (same host, post, attributes, etc) both in the dead set and alive one (different instances of the connection, not the same).

I've added debug logs to __rebuild_connections and this is what I got:

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 14
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 15

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 15
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 16

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 16
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 17

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 17
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 18

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 18
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 19

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 19
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 20

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 20
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 21

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 21
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 22

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 22
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 23

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 23
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 24

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 24
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 25

Hosts count: 14
new_connections size: 14
stale_connections size: 0
new_connections (after reject) size: 1
@connections.all size: 25
@connections size: 13
@connections (after) size: 14
@connections.all (after) size: 26

If I'm correct, we need to replace

new_connections = new_connections.reject { |c| @connections.include?(c) }

with

new_connections = new_connections.reject { |c| @connections.all.include?(c) }

Originally posted by @andrepcg in #695 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@picandocodigo and others