FunctionExecution fails with IOException while sending the last chunk to client (SocketException: Broken pipe)
search cancel

FunctionExecution fails with IOException while sending the last chunk to client (SocketException: Broken pipe)

book

Article ID: 431890

calendar_today

Updated On:

Products

VMware Tanzu Data Suite VMware Tanzu Data Suite Pivotal GemFire VMware Tanzu Gemfire VMware Tanzu Greenplum / Gemfire VMware Tanzu Data Intelligence

Issue/Introduction

During execution of a function, the server logs the following exception:

org.apache.geode.cache.execute.FunctionException: IOException while sending the last chunk to client
Caused by: java.net.SocketException: Broken pipe

This indicates that the server could not complete the last chunk of the result‑stream back to the client, even though the function itself completed on the server.

Cause

The client side of the TCP connection has gone away or been closed (for example, due to a timeout, network issue, or client‑side shutdown) before the server could finish sending the final result chunk. The Broken pipe at SocketException level means that the client’s TCP socket is no longer accepting data, so the server write fails when it tries to send the last chunk.

The cause of it could be because of :

  • Large function result sets 
  • Client‑side timeouts expiring while the server is still streaming results.
  • Unhandled exceptions on the client side
  • Network terminating idle connections, especially during long‑running function executions.

 

Resolution

In order to resolve this issue, we can try the following options:

  • Adjust client‑side timeouts
  • Tune message‑size and chunking behavior
  • Review network and firewall configuration
  • Handle the exceptions on the client

 

Additional Information

https://knowledge.broadcom.com/external/article/294416/messagetoolongexception-messagetoolargee.html