Apologies for a second posting to the list, but the ASF JIRA is preventing me from creating KAFKA- tickets so I wanted to report this issue. This seems to be a critical bug with KStreams, the .lock files in the state store directories do not seem to be having their file handles freed (despite the locks being freed), so on a complex job the number of file handles in use goes up rapidly as the locks are taken for the cleanup routine at the end of the thread run loop. I've created a PR that seems to resolve this issue:
https://github.com/apache/kafka/pull/1267