Proposed fix for : 3653 : Cancel not working even after disconnecting (#797)

* Proposed changes to stop query execution if an exception has occured before/during batch execution

* Sending the error message was causing a test to fail - so removing for now. We can update the test to expect this is needed.
This commit is contained in:
udeeshagautam
2019-05-14 16:15:09 -07:00
committed by GitHub
parent 2e2b764c6d
commit c86f43618c
2 changed files with 9 additions and 3 deletions

View File

@@ -638,7 +638,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
// if any oldQuery exists on the executeParams.OwnerUri but it has not yet executed,
// then shouldn't we cancel and clean out that query since we are about to create a new query object on the current OwnerUri.
//
if (ActiveQueries.TryGetValue(executeParams.OwnerUri, out oldQuery) && (oldQuery.HasExecuted || oldQuery.HasCancelled))
if (ActiveQueries.TryGetValue(executeParams.OwnerUri, out oldQuery) && (oldQuery.HasExecuted || oldQuery.HasCancelled || oldQuery.HasErrored))
{
oldQuery.Dispose();
ActiveQueries.TryRemove(executeParams.OwnerUri, out oldQuery);