I’m encountering an issue while writing data to my server. I am currently importing 60 million products, but after importing approximately 20,000 products, the server often stops processing additional data and returns the following error message:
2024-06-28T18:36:00.159+0200 INFO repository/mtc_product_repository.go:113 Failed to execute bulk indexing {"retryCount": 0, "error": "Post \"http://localhost:9308/bulk\": read tcp 127.0.0.1:50890->127.0.0.1:9308: read: connection reset by peer"}
2024-06-28T18:36:00.159+0200 INFO repository/mtc_product_repository.go:113 Failed to execute bulk indexing {"retryCount": 0, "error": "Post \"http://localhost:9308/bulk\": read tcp 127.0.0.1:50874->127.0.0.1:9308: read: connection reset by peer"}
I am currently using a Docker container for this process, and I suspect that the issue might be related to resource exhaustion or some other limitation within the container.
Does anyone have an idea what might be causing this issue and how I can resolve it?
When I execute the HTTP request in my code, the above error occurs:
The error in your code occurs when the HTTP request (req) to the HTTP client fails. This happens within the call
resp, err := repo.apiClient.GetConfig().HTTPClient.Do(req)
if err != nil {
repo.provider.logger.Info("Failed to execute bulk indexing", zap.Int("retryCount", retryCount), zap.Error(err))
docker logs do not show any errors.
on the second or third attempt, it will take over the data.
The message “connection reset by peer” means that the connection was unexpectedly terminated by the other side (the “peer”).