Moving some logic around such that when a query is cancelled, it isn't thrown away, allowing reading of the partial results, a la SSMS.
Adding a configure await to fix a tenacious bug causing query cancellations to hang for 20s or more.
Capturing sql errors for user cancellation, to return all user cancelation scenarios using the same messages. (ie, cancelling during ExecuteReaderAsync will yield a error from the server whereas cancelling during ReadAsync throws a TaskCancelledException
No changes to protocol, just implementation changes.
* Test of try/finally
* Fixed issue where resultsets are unreadable after query cancellation
* Fix for await/async issue
The two main changes in this pull request:
Launching query execution as an asynchronous task that performs a callback upon completion or failure of a query. (Which also sets us up for callbacks progressive results)
Moving away from using the Result of a query execution to return an error. Instead we'll use an error event to return an error
Additionally, some nice refactoring and cleaning up of the unit tests to take advantage of the cool RequestContext mock tooling by @kevcunnane
* Initial commit of refactor to run execution truely asynchronously
* Moving the storage of the task into Query class
Callbacks for completion of a query and failure of a query are setup as
events in the Query class. This actually sets us up for a very nice
framework for adding batch and resultset completion callbacks.
However, this also exposes a problem with cancelling queries and returning
errors -- we don't properly handle errors during execution of a query
(aside from DB errors).
* Wrapping things up in order to submit for code review
* Adding fixes as per comments
* Remove extra layer of tasks in binding queue
* Change order of assigning result to avoid race condition
* Add timeout log for the metadata lock event
* Fix test cases
* Implemented connection cancellation
* Made connect requests return immediately and created a separate connection complete notification
* Fix spelling
* Fix sorting
* Add separate lock for cancellation source map
* Initial code for binding queue
* Fix-up some of the timeout wait code
* Add some initial test code
* Add missing test file
* Update the binding queue tests
* Add more test coverage and refactor a bit. Disable reliabile connection until we can fix it..it's holding an open data reader connection.
* A few more test updates
* Initial integrate queue with language service.
* Hook up the connected binding queue into al binding calls.
* Cleanup comments and remove dead code
* More missing comments
* Fix build break. Reenable ReliabileConnection.
* Revert all changes to SqlConnectionFactory
* Resolve merge conflicts
* Cleanup some more of the timeouts and sync code
* Address code review feedback
* Address more code review feedback
Fixing a bug where in various situations, the files used for temporary storage of query results would be leftover. In particular, the following changes were made:
* When the dispose query request is submitted, the corresponding query is now disposed in addition from being removed from the list of active queries
* When a query is cancelled, it is disposed after it is cancelled
* If a query already exists for a given ownerURI, the existing query is disposed before creating a new query
* All queries are disposed when the query execution service is disposed (ie, at shutdown of the service)
A unit test to verify the action of the dispose method for a ResultSet was added.
* Ensuring queries are disposed
Adding logic to dispose any queries when:
* URI that already has a query executes another query
* A request to dispose a query is submitted
* A request to cancel a query is submitted
* Small tweaks for cleanup of query execution service
* added support for timestamps
* fixed tests
* Moved message class to own file; added 'z' to end of date strings
* added default time constructor
* removed unnecessary z
* added time string format info in comment
* changed from utc time to using local time
* Do not use ReliableCommand in the query execution service.
* Fixing the logic to remove InfoMessage handlers from ReliableSqlConnection
* Adding test to query UDT
* Enable IntelliSense settings
* Fix up some bugs in the IntelliSense settings.
* Code cleans for PR
* Fix a couple exceptions that are breaks query execute and intellisense.
* Add useLowerCase flag and settings tests
* inital pipe of line numbers and getting text from workspace services
* tests compile
* Fixed bug regarding tests using connections on mac
* updated tests
* fixed workspace service and fixed tests
* integrated feedback
* WIP for ability to localize cell values
* Changing how DateTimeOffsets are stored, getting unit tests going
* Reworking BufferFileStreamWriter to use dictionary approach
* Plumbing the DbCellValue type the rest of the way through
* Removing unused components to simplify contract
* Cleanup and making sure byte[] appears in parity with SSMS
* CR comments, small tweaks for optimizing LINQ
Fixing a bug from the unit tests on OSX/Unix where attempting to create a file with a name that's all whitespace succeeds when it should fail. This was passing in Windows because File.Open throws an ArgumentException when an all whitespace name is provided. In Unix systems, File.Open does not throw, causing the test to fail.
Solution is to check for whitespace in the sanity check.
* Strings sweep for connection service
* String sweep for credentials service
* String sweep for hosting
* String sweep for query execution service
* String sweep for Workspace service
* Renaming utility namespace to match standards
Renaming Microsoft.SqlTools.EditorServices.Utility to
Microsoft.SqlTools.ServiceLayer.Utility to match the naming changes done a
while back. Also renaming them on the files that use them
* Namespace change on reliable connection
* Adding the new resx and designer files
* Final bug fixes for srgen
Fixing flakey moq package name
* Removing todo as per @kevcunnane
* Adding using statements as per @llali's comment
* Fixing issues from broken unit tests
Note: This feature contains changes that will break the contract for
saving as CSV and JSON. On success, null is returned as a message instead
of "Success". Changes will be made to the vscode component to handle this
change.