microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.56k stars 901 forks source link

Query Hangs #7440

Open mackenziepsilb opened 5 years ago

mackenziepsilb commented 5 years ago

Issue Type: Bug

Sometime when running queries it just sits there saying executing query and doesn't finish. I have to quit Azure Data Studio, reconnect to the SQL Server and then run the query and it works.

Azure Data Studio version: Azure Data Studio 1.11.0 (460c739a8d90bdbbde39e01abfb8ecdc278ea787, 2019-09-06T17:14:33.682Z) OS version: Darwin x64 18.7.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2700)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|16.00GB (0.47GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions: none
cheenamalhotra commented 1 year ago

@DeanBecker

Can you provide me more details on the dataset that didn't cancel instantly? Query, datatypes being read with a sample row (number of columns) and number of rows that I can replicate should help.

I would like to make sure:

Update: I found a use-case with large column data: #24227 so will be investigating that separately.

romanovmv commented 1 year ago

I knew this day would finally happen when I'm be able to use Azure DS without being afraid of running a query and getting another "hang"! Hooray! ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

romanovmv commented 1 year ago

Whoever fixed it please give them a pay rise ๐Ÿ˜‚

Ben-in-CA commented 1 year ago

Unfortunately, I just had this full hang issue again on Insiders.

Version: 1.46.0-insider (system setup) Commit: e3ab53ebe2f92d5432b844e52d4a79dc1fa3bd2a Date: 2023-08-30T05:36:32.509Z VS Code: 1.79.2 Electron: 22.3.14 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

Stayed on this (left for a minute plus)

image

Pressed Cancel several times, did nothing. Just stayed displaying the above for maybe 5 minutes until I closed Insiders. (never counted up, never cancelled.)

I could open up my older version (non-insiders) and complete the query just fine. (No problem with query, and was able to complete it while Insiders was hung up - connection was okay.)

Also, just to note - the program wasn't unresponsive as far as Windows was concerned - could switch between Azure Data Studio tabs, etc. (couldn't run queries in other tabs either though.) It closed right away when I hit X.

angel-torres commented 1 year ago

I also have been having the full hang the last few days. It was doing great for a while.

Version: 1.45.1 (user setup) Commit: 88c21b1725a3e79440027bdb7b5a55fb036be0e2 Date: 2023-08-03T00:42:37.945Z VS Code: 1.79.2 Electron: 22.3.14 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621

Angel Torres

Technical Support Technician, Food, Beverage & Consumer Goods

TELUS Agriculture & Consumer Goods (Formerly Exceedra) M: +1 813 909 3221 telus.com/agcg https://www.telus.com/agcg LinkedIn https://www.linkedin.com/company/telus-agcg Twitter https://www.twitter.com/TELUS_AGCG YouTube https://www.youtube.com/c/TELUS_AGCG Instagram https://www.instagram.com/telus Facebook https://www.facebook.com/telus

This email, including any attachments, is for the sole use of the intended recipient and may contain confidential information. If you are not the intended recipient, please notify us immediately and destroy this email and any copies.

On Thu, Aug 31, 2023 at 12:55โ€ฏPM Ben-in-CA @.***> wrote:

Unfortunately, I just had this full hang issue again on Insiders.

Version: 1.46.0-insider (system setup) Commit: e3ab53e https://github.com/microsoft/azuredatastudio/commit/e3ab53ebe2f92d5432b844e52d4a79dc1fa3bd2a Date: 2023-08-30T05:36:32.509Z VS Code: 1.79.2 Electron: 22.3.14 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

Stayed on this (left for a minute plus)

[image: image] https://user-images.githubusercontent.com/34966974/264716945-0eb31015-c2d9-481e-b596-31c016b5d7a4.png

Pressed Cancel several times, did nothing. Just stayed displaying the above for maybe 5 minutes until I closed Insiders. (never counted up, never cancelled.)

I could open up my older version (non-insiders) and complete the query just fine.

โ€” Reply to this email directly, view it on GitHub https://github.com/microsoft/azuredatastudio/issues/7440#issuecomment-1701416145, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5LYNJ43FERYLTBUZGMZIQDXYC6XPANCNFSM4I4KOTVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

CONFIDENTIALITY NOTICE: This email, including any attachments, is for the sole use of the intended recipient and may contain confidential information. If you are not the intended recipient, please notify us immediately and destroy this email and any copies.

erinstellato-ms commented 1 year ago

@angel-torres the fix mentioned by Cheena (https://github.com/microsoft/azuredatastudio/issues/7440#issuecomment-1692517196) is only available in the Insider build. If you have the ability to download it and use it instead of 1.45.1 to see the Insider build resolves what you're seeing, that would be great.

@Ben-CA Can you provide more details on the dataset that didn't cancel instantly? Query, datatypes being read with a sample row (number of columns) and number of rows that we can replicate should be helpful. Also, to what version/flavor of SQL are you connecting? Also, note this issue with large column data: https://github.com/microsoft/azuredatastudio/issues/24227, not sure if it's related, we're investigating that separately.

Ben-in-CA commented 1 year ago

In this case it was an UPDATE query like this; only affected one row. Only took 2 seconds when I ran it later.

UPDATE [dbo].[IMC] SET IMC_StdMatlAmt = '5', IMC_AcctMatlAmt = '5' FROM [dbo].[IMC] AS IMC INNER JOIN [dbo].[Item] AS I ON IMC.IMC_IMA_RecordID = I.IMA_RecordID WHERE I.IMA_NoRevisionItemID = '11111111';

Both of the affected tables are medium length (~ 30,000 rows) but have quite a few columns. IMC has 65, and Item has 202.

SQL Server 2008 (upgrade plans finally in progress!)

I don't think it's related to #24227.

The biggest challenge is that it's quite inconsistent.

cheenamalhotra commented 1 year ago

@Ben-CA @angel-torres

We're not ruling out other possibilities, so there're definitely more paths to cover.

I'd request you to keep capturing MSSQL verbose logging, so if you do face it again, logs can be fetched, and you can upload them in a new issue.

Ben-in-CA commented 1 year ago

Thanks; I've enabled verbose logging.

jonmozley commented 11 months ago

Version: 1.46.1

Commit: ba29842b81dec01177415e53948ca2168e69c3f8

Date: 2023-10-02T18:14:22.887Z (1 mo ago)

VS Code: 1.79.2

Electron: 22.3.25

Chromium: 108.0.5359.215

Node.js: 16.17.1

V8: 10.8.168.25-electron.0

OS: Windows_NT x64 10.0.19045

I've not read the whole thread but think my colleague and I have this issue. I'm running v1.46.1 and will regularly see ADS hang when querying Azure SQL Databases. No pattern to what type of query causes it. Sometimes happens just when trying to expand Object Explorer.

Cancelling the query or disconnecting the server have no effect. Restarting ADS works, or disconnecting the WiFi which seems to make it realise the connection has failed. No issues when connecting to on prem SQL Server as far as I can recall.

FWIW, I don't remember this being an issue until the last couple of months when our client laptop changed the VPN provider.

cheenamalhotra commented 11 months ago

@jonmozley could you try gathering MSSQL verbose logs and extract them for the event when it occurs, we can investigate if there are any exceptions captured by the services, or any helpful info we can retrieve.

Please open a new issue with the logs attached, make sure you mask any sensitive information.

erinstellato-ms commented 11 months ago

@jonmozley Adding on to @cheenamalhotra's request - the latest release is 1.47. Ideally, if you could upgrade to that release and re-test, and gather logs from there? Thank you!

benharpers commented 8 months ago

This happens to me all day, most days. What I notice first is that the auto-complete/IntelliSense suggestions stop working while I'm editing, and if there is an error in the code, it will stay errored/red even if you fix it; hovering over things says "waiting..." or something; and then when you try to run a query, it will hang, mostly the Messages window will stay completely empty (no "Started executing query at Line 1...") and sometimes the runtime counter will not start. If you wait forever, sometimes it will recover, but mostly you have to quit and restart. If you click "Cancel" on the query window, it doesn't do anything at all. I could get the logs but many people have already provided examples.

I'm on the Mac version, 1.47.1. It's been happening since before 1.30. Our server is 2019 running in AWS. I have been trying to show the rest of our team how great ADS is for developing, but they ran into these same issues on Windows. Some users have issues, others do not.

It breaks our source control processes because users feel unproductive having to restart ADS all day and so they resort to copy-pasting their code to SSMS rather than staying in ADS with GIT.

This has been going on for far too long, this issue was opened in 2019. We have been running into it for almost 2 years, we keep hoping that every upgrade has finally fixed it only to find it come back a few days later. When it happens, it happens a lot. Sometimes you get a break for a few days at most but it comes back.

At a minimum, there should be some way ADS can detect a broken connection and restart the connection pool/networking or whatever it needs to in the background so you don't loose the connections in all your tabs like you do when you quit. A popup like "ADS has detected a network issue, would you like to reset the connection pool?". Or at least add an option to the command palette that can reset the connections and keep the windows/tabs setup as they were so they can reconnect themselves.

"Disconnecting" using the Connections tab currently doesn't seem to actually do anything, it just collapses the databases list and turns red, but it doesn't seem to actually close the connection pool as it should... what is the purpose of disconnecting as a feature in the way it is right now? Just the illusion of disconnecting. It really should be dropping the connection and force stopping anything that is running.

Anyhow, this is really a priority, there would be no way of knowing how many people have given up on using ADS because of this, I'm sure it's a lot.

ccpjulia commented 8 months ago

Hi, It seems like the bug is back. I am using ADS on a daily basis and the bug appeared significantly less (monthly as opposed to daily before) the past months, but now it is back with a vengeance - making it a hassle to use again.

Hope this get's fixed soon ๐Ÿคž

Let me know if you need more info!

romanovmv commented 6 months ago

Hi, I can confirm the bug is back. I'm on version 1.48.0 and the "Parallel Message Processing" setting is on. This is what I see in the profiler, multiple queries to fetch the meta: image

anjode commented 5 months ago

Hi, I can confirm the bug is back. I'm on version 1.48.0 and the "Parallel Message Processing" setting is on. This is what I see in the profiler, multiple queries to fetch the meta: image

Same here. I reverted to 1.47 and no issues. But 1.48 is nearly unusable.

raeokay commented 5 months ago

The only way I've gotten this to stop is to entirely disable Intellisense. It's extremely annoying, and removes important functionality, but I can at least open and run a query.

anjode commented 5 months ago

I'd hate to lose IntelliSense. But if it makes it work then it would be worth it as the tool has become indispensable for SQL development.

Snefheff commented 5 months ago

benharpers description is spot on, especially around the IntelliSense how it will suddenly stop working and then it's over.

I don't think it's the cause, but once the hang starts, switching to any other windows with a result set will leave the result grid empty and unable to paint the preexisting results.

version 1.48 dedicated sql pool

anjode commented 4 months ago

The only way I've gotten this to stop is to entirely disable Intellisense. It's extremely annoying, and removes important functionality, but I can at least open and run a query.

Intellisense definitely seems to be related to the problem. I've been using it for several days with intellisense turned off and haven't had a single query hang.

rvstrong commented 4 months ago

I've same issue when it says "Executing query..." in the bottom and nothing works until you restart it.

How did you guys disable the IntelliSense? There are many settings when I check File > Preferences > Settings >Text Editor > Suggestions.

I tried turning off Inline suggest, but issue is still keep coming. what settings you guys used? @anjode @raeokay

raeokay commented 4 months ago

I've same issue when it says "Executing query..." in the bottom and nothing works until you restart it.

How did you guys disable the IntelliSense? There are many settings when I check File > Preferences > Settings >Text Editor > Suggestions.

I tried turning off Inline suggest, but issue is still keep coming. what settings you guys used? @anjode @raeokay

I think the one that did it was unchecking "Mssql > Intelli Sense: Enable Intelli Sense." Just search for "intellisense" in preferences and it'll be near the top.

anjode commented 4 months ago

I've same issue when it says "Executing query..." in the bottom and nothing works until you restart it. How did you guys disable the IntelliSense? There are many settings when I check File > Preferences > Settings >Text Editor > Suggestions. I tried turning off Inline suggest, but issue is still keep coming. what settings you guys used? @anjode @raeokay

I think the one that did it was unchecking "Mssql > Intelli Sense: Enable Intelli Sense." Just search for "intellisense" in preferences and it'll be near the top.

@raeokay I unchecked "Mssql > Intelli Sense: Enable Intelli Sense" but also "Mssql > Intelli Sense: Enable Quick Info" and "Mssql > Intelli Sense: Enable Suggestions".

bronthulke commented 1 month ago

I appreciate that turning off feature can potentially resolve this, but it's been a few years now, and those of us who have loyalty to this product are dying here!

When can we hope to see the underlying issue fixed, without us needing to turn off a key feature?

I find that copying data also sometimes comes up against the same issue where it just locks up and I have to restart the whole program and start again.

Looooooka commented 1 day ago

This happens in SQL Management Studio as well. ALL VERSIONS when using Azure SQL. Never happens on local machines. To reproduce you simply have to leave SQL Management Studio or Azure Data Studio open over night...come back and try to execute the query. The worst part is this happens randomly through out the day as well. So even if this is a connection issue both of these programs should be able to detect that and just cancel the call instead of us being forced to kill them with a task manager. This has been happening for over a year now and Microsoft has done NOTHING about it.

erinstellato-ms commented 1 day ago

Hi @Looooooka - First, thank you for reporting the issue with SSMS.

Second, please note that issues for SSMS should be logged on the SQL feedback site: aka.ms/sqlfeedback. I don't want to move this thread, as I'd like to understand your challenge, but moving forward, please make sure to log any request or issue there.

Third, can you provide more information such as what version of SSMS you're running, and what database you're connected to (e.g. SQL Server 2019, Managed Instance, Azure SQL DB serverless, etc.)? I leave SSMS open for days at a time, and I do not have this issue, but I know that everyone has a different environment/scenario. If you can provide more detail about the state SSMS is in at the end of the day (e.g. is Object Explorer open, is this only in the Query Editor, etc.)? Thank you.