Got it

The Connection Is Interrupted Unexpectedly When Multiple Threads Concurrently Write Data to Elasticsearch

131 0 0 0 0

Hello all, 

this case mainly talks about "The Connection Is Interrupted Unexpectedly When Multiple Threads Concurrently Write Data to Elasticsearch"

Applicable Version

6.5.x

Context and Symptom

When multiple threads concurrently write data to Elasticsearch, the connection is interrupted and the error message "error while performing request" is displayed. After DEFAULT_CONNECTION_REQUEST_TIMEOUT_MILLIS=-1 is modified, the error message "Request cannot be executed; I/O reactor status :STOPPED." is displayed.

Cause Analysis

If the value of the DEFAULT_CONNECTION_REQUEST_TIMEOUT_MILLIS parameter in the RestClient is small, the HTTP connection pool may fail to obtain connections within the specified period.

The RestClient invokes the CloseableHttpAsyncClient to execute the request. At the beginning of the execution, the RestClient checks the status. If the status is not active, the preceding error is reported.

In the error message, the value of status is STOPPED, indicating that the RESTClient is disabled. There is a high probability that multiple threads in the service program share the RESTClient. A thread disables the RESTClient after invoking it. As a result, an error is reported when other threads send requests.

Solution

Modify the service code on the ISV to ensure that the RESTClient resource created is not released in the threads.

Any solutions will be appreciated!

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.