ranguba / groonga-client

Groonga-client is a client for Groonga (http://groonga.org/) implemented with pure ruby.
12 stars 5 forks source link

Error occurs while inserting a lot of records #27

Open okkez opened 7 years ago

okkez commented 7 years ago

I'm trying to load records from some CSV files. CSV files include about 10000 records in a file.

I got following errors sometimes. (sometimes load all records successfully)

groonga-client-0.5.0/lib/groonga/client/protocol/http/synchronous.rb:56:in `rescue in send': Failed to open TCP connection to 127.0.0.1:10041 (Cannot assign requested address - connect(2) for "127.0.0.1" port 10041) (Groonga::Client::Protocol::WrappedError)
        from /home/xxx/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/groonga-client-0.5.0/lib/groonga/client/protocol/http/synchronous.rb:38:in `send'
        from /home/xxx/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/groonga-client-0.5.0/lib/groonga/client/protocol/http/thread.rb:39:in `block in send'
bin/rails r data/load-ekidata.rb all  29.60s user 25.25s system 94% cpu 58.137 total

Why?

okkez commented 7 years ago

I'm using groonga-client via groonga-client-model.

komainu8 commented 7 years ago

Probably, this error cause is lack ephemeral port in OS. When error occur, Would you execute ss -tan | awk '{print $1}' | uniq -c and count number of TIME_WAIT?

okkez commented 7 years ago

I could not take log at the time when error occurred. This is log just before error occurred.

$  ss -tan | awk '{print $1}' | sort | uniq -c
      7 CLOSE-WAIT
    101 ESTAB
     33 LISTEN
      1 State
  25683 TIME-WAIT