{"action":"opened","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5244","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5244/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5244/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5244/events","html_url":"https://github.com/orientechnologies/orientdb/issues/5244","id":114050798,"number":5244,"title":"OSQLNonBlockingQuery misbehaves on bad SQL input","user":{"login":"cstamas","id":45165,"avatar_url":"https://avatars.githubusercontent.com/u/45165?v=3","gravatar_id":"","url":"https://api.github.com/users/cstamas","html_url":"https://github.com/cstamas","followers_url":"https://api.github.com/users/cstamas/followers","following_url":"https://api.github.com/users/cstamas/following{/other_user}","gists_url":"https://api.github.com/users/cstamas/gists{/gist_id}","starred_url":"https://api.github.com/users/cstamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstamas/subscriptions","organizations_url":"https://api.github.com/users/cstamas/orgs","repos_url":"https://api.github.com/users/cstamas/repos","events_url":"https://api.github.com/users/cstamas/events{/privacy}","received_events_url":"https://api.github.com/users/cstamas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-29T13:37:23Z","updated_at":"2015-10-29T13:37:23Z","closed_at":null,"body":"When using OSQLNonBlockingQuery with bad (malformed, having bad syntax) query, the OSQLNonBlockingQuery will misbehave by not reporting it back to caller in any way. Even worse, the caller remains unaware what actually happened.\r\n\r\nOn execute OSQLNonBlockingQuery will start another thread:\r\nhttps://github.com/sonatype/orientdb/blob/aecb7a891e945575c3ceb6ff29341ca68551df98/core/src/main/java/com/orientechnologies/orient/core/sql/query/OSQLNonBlockingQuery.java#L246\r\n\r\nBut the execution will fail (on newly started thread) but nothing will notify the listener about it, nor end method will be invoked of listener.\r\n\r\nExample stack trace (SQL broken intentionally for example sake):\r\nException in thread \"Thread-121\" com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.SELECTbrokenForExample\r\n\tat com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:72)\r\n\tat com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:42)\r\n\tat com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1431)\r\n\tat com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:72)\r\n\tat com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:33)\r\n\tat com.orientechnologies.orient.core.sql.query.OSQLNonBlockingQuery.access$001(OSQLNonBlockingQuery.java:48)\r\n\tat com.orientechnologies.orient.core.sql.query.OSQLNonBlockingQuery$1.run(OSQLNonBlockingQuery.java:251)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n\r\nAlso, note the use of printStackTrace"}}