Steps to reproduce
- A task executor sends an async 'fetch and lock' request to the REST API with an asyncResponseTimeout
- The REST API queues the request as no external tasks are available to fetch and lock; The connection is kept alive
- The task executor does not wait for the async response and cancels the connection
- An external task instance is started
The external task instance is fetched and locked although no client is actively waiting for it.
The fetched and locked external task is unlocked if the response could not be sent back to the client as the client-side socket has been cleaned-up by the operating system.
The server can only unlock the fetched and locked external task if the client-side socket has been cleaned-up by the kernel. If the client-side socket is in state FIN_WAIT_2, the server completes the cancelled request successfully. This is an operating system specific and beyond control of Camunda BPM.