shanyu zhao created LIVY-617: -------------------------------- Summary: Livy session leak on Yarn when creating session duplicated names Key: LIVY-617 URL: https://issues.apache.org/jira/browse/LIVY-617 Project: Livy Issue Type: Bug Components: Server Affects Versions: 0.6.0 Reporter: shanyu zhao
When running Livy on Yarn and try to create session with duplicated names, Livy server sends response to client "Duplicate session name: xxx" but it doesn't stop the session. The session creation failed, however, the Yarn application got started and keeps running forever. This is because during livy session register method, exception "IllegalArgumentException" is thrown without stopping the session: {code:java} def register(session: S): S = { info(s"Registering new session ${session.id}") synchronized { session.name.foreach { sessionName => if (sessionsByName.contains(sessionName)) { throw new IllegalArgumentException(s"Duplicate session name: ${session.name}") } else { sessionsByName.put(sessionName, session) } } sessions.put(session.id, session) session.start() } session }{code} Reproduction scripts: curl -s -k -u username:password -X POST --data '\{"name": "duplicatedname", "kind": "pyspark"}' -H "Content-Type: application/json" 'https://myserver/livy/v1/sessions' -- This message was sent by Atlassian JIRA (v7.6.14#76016)