SocketTimeoutException
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
-
What is the underlying cause of java.lang.RuntimeException: java.net.SocketTimeoutException
-
2021-06-18 07:55:41.652 ERROR [liferay/segments_entry_reindex-2][ElasticsearchIndexSearcher:165] java.lang.RuntimeException: java.net.SocketTimeoutException: 120,000 milliseconds timeout on connection http-outgoing [ACTIVE]
at com.liferay.portal.search.engine.adapter.search.SearchSearchRequest.accept(SearchSearchRequest.java:34)
Resolution
- It is something that is more of an environmental-specific issue than a Liferay product issue.
- It clearly means a
SocketTimeoutException in the case of the accept(). Therefore, tweak the timeout barrier such that it is more flexible on network delays to avoid this issue might be tried. Especially if the server application will be running on a remote machine. Aside from that, the issue must be investigated to see what is causing network delays, such as a broken router.
- There might be chances that consumers have a shorter TCP keep-alive timeout configured in their environment than the 120 seconds socket timeout we set on the HTTP client or their firewall may drop connections earlier than the keepalive probe could be sent. Therefore, it would be helpful in this matter to check whether they have any network device (Loadbalancer, Firewall, Proxy, etc.) between their client and server which has a session timeout or similar and either increase that timeout or lower the tcp_keep_alive kernel parameter.
Did this article resolve your issue ?