An external stored procedure that returns from the C or C++ function before an outstanding request is complete generates a 7835 failure, aborting the transaction and the external stored procedure and any nested stored procedures if the external stored procedure was in a nested call. The failure is returned to the client application.
The best practice for an external stored procedure is to complete any outstanding request before returning from the function, clean up any logged on connections, and release allocated memory.