The solution is to use the closeAllConnections() command if sink() does not close the connection on its own.