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.58k stars 903 forks source link

Azure Data Studio is getting hanged while trying to see SQL SKU recommendation list. #24054

Open Ramudaykumar opened 1 year ago

Ramudaykumar commented 1 year ago

Steps to Reproduce:

  1. Connect to any SQL server instance, which is having DB in large number say 600 plus.
  2. Run Azure SQL migration, do assessment for all DBs.
  3. Run SKU recommendation, once complete try to see DB recommendations. it is getting hanged and suggesting to close ADS again and again. Or try to select deselect DBs for migrating it also gets stuck and some time it starts flickering. Flickering is not easily reproduced. I have seen this for just 2 times in last 2 days of testing.

Flickering recording Profiling of ADS

Does this issue occur when all extensions are disabled?: No (I cannot find any tree view without extension so can't reproduce without

Ramudaykumar commented 1 year ago

ADS hanged and asking to close

cheenamalhotra commented 1 year ago

Hi @Ramudaykumar

I've captured from v1.44.1: Consistent 100% usage for this scenario, and I think that's just a lot of content being rendered at once that's causing this!

image

leading to doubled Dom components when opened recommendation second time: image

So you can see that components are not clearing out and are leaking resources.

What's different in ADS now is that it's crashing instead - that was still taking up that load before. @aasimkhan30 anything we can do here to allow this massive Dom component usage?

Charles-Gagnon commented 1 year ago

Here's a script to create (and drop) 500 dbs for testing if anyone else is looking at this

-- CREATE

declare @i int = 1
while @i < 500
begin
    declare @script nvarchar(max) = 'CREATE DATABASE testdb' + CAST(@i as nvarchar)
    exec sp_executesql @script
    set @i = @i + 1
end

-- CLEANUP

/**
DECLARE @cmd nvarchar(max)
DECLARE cmds CURSOR FOR
SELECT 'drop database [' + name + ']'
FROM sys.databases
WHERE name LIKE 'testdb%'

OPEN cmds
WHILE 1 = 1
BEGIN
    FETCH cmds INTO @cmd
    IF @@fetch_status != 0 BREAK
    EXEC(@cmd)
END
CLOSE cmds;
DEALLOCATE cmds
*/
cheenamalhotra commented 1 year ago

Ran SKU recommendation again on a fresh instance of ADS 1.45-RC1.. I see it loaded report properly.. and held up to resources/DOM nodes:

Report generated successfully for 604 databases: image

So it seems Crashes are not consistently happening too, it only crashed once for me but I could restart ADS and continue again. App hangs same way as it does in 1.44.1 and CPU usage is also consistent.

cheenamalhotra commented 1 year ago

Hi @Ramudaykumar

Is this issue still occurring with latest insiders build?