Bug Description
When connecting to a Fabric Lakehouse SQL Analytics Endpoint, schema introspection issues two queries that are not valid against this engine:
sys.dm_db_partition_stats — documented as unsupported on Synapse serverless SQL pool, and Fabric SQL endpoints share the same restricted surface.
sys.pdw_table_distribution_properties — a PDW/dedicated-pool-only catalog view, also invalid here.
Both fail and fall back to the cached schema.
This is observed using both the Fabric SQL Analytics Endpoint and Azure Synapse connectors.
Repro steps
- Connect to a Fabric Lakehouse's SQL Analytics Endpoint (via either the Synapse or Fabric connector).
- Open a
.sql scratch file / restore a previous session with one open.
- Let DBCode run its normal schema introspection on connect.
- Observe both queries fail in the Output → DBCode channel.
- (Synapse connector only) Observe the LS watchdog deadline/probe-failed/recycle sequence shortly after.
Expected behavior
- Introspection recognizes the
fabric or azuresynapse dialect and skips sys.dm_db_partition_stats and sys.pdw_table_distribution_properties.
Actual Behavior
- Via the Synapse connector, the failed queries block long enough that the LS watchdog's
activeStatement deadline trips, logs a probe-failed (timeout), a Stopping server timed out error, then force-recycles the language server process (recycle → sigkill). The connection recovers on the next generation, but this adds ~10+ seconds of stall and a full LS process kill/restart on every session that touches this connection.
- Via the new Fabric connector, the same two queries fail in the same order but resolve in under a second with no watchdog involvement at all — the connector correctly treats the failure as non-blocking and falls back to cache immediately.
Environment
- VS Code version: 1.138.0
- DBCode extension version: 1.38.5
- OS: Windows 11, x64
- Database engine: Microsoft Fabric SQL Analytics Endpoint (Lakehouse, Delta-table backed)
- Reproduced against the same target via both:
- the Synapse connector, dialect reported as
azuresynapse:SQL Azure - 12.0.2000.8
- the newer Fabric connector, dialect reported as
fabric:SQL Azure - 12.0.2000.8
- Connection type: direct (no SSH/SSL tunnel)
Logs
Synapse connector:
[info] Connection: opened '<lakehouse>' on '<workspace-connection>' (azuresynapse:SQL Azure - 12.0.2000.8)
[Debug] SchemaFactory: Attempting to load schema from storage for '<lakehouse>' on connection '<connection-id>'
[info] LS watchdog: {"event":"deadline","route":"activeStatement","generation":1,"processId":<pid>,"dialect":"SQL Server","uri":"untitled:Untitled-1","version":1,"characterCount":56,"lineCount":2,"elapsed":5474}
[Debug] [STUB] Skipping createDirectory for <globalStoragePath> (read-only mode)
[info] LS watchdog: {"event":"probe-failed","route":"activeStatement","generation":1,"processId":<pid>,"dialect":"SQL Server","uri":"untitled:Untitled-1","version":1,"characterCount":56,"lineCount":2,"probeOutcome":"timeout"}
[Debug] FileStore: Read file 'schemas/<connection-id>/<lakehouse>.data', bytes: 2807758
[Debug] FileStore: Parsed file 'schemas/<connection-id>/<lakehouse>.data', format: 'cbor'
[error] MSSQL: Error executing query on '<workspace-connection>', error: 'DMV (Dynamic Management View) 'dm_db_partition_stats' is not supported.'
[Debug] SchemaFactory: Loaded V2 schema from storage for '<lakehouse>' on connection '<connection-id>'
[Error] Stopping server timed out
[Debug] SchemaFactory: Attempting to load databases from storage for connection '<connection-id>'
[Debug] FileStore: Read file 'schemas/<connection-id>/<connection-id>.data', bytes: 5154
[info] LS watchdog: {"event":"recycle","route":"activeStatement","generation":1,"processId":<pid>,"dialect":"SQL Server","uri":"untitled:Untitled-1","version":1,"characterCount":56,"lineCount":2,"probeOutcome":"unresponsive","recycleOutcome":"sigkill"}
[Debug] FileStore: Parsed file 'schemas/<connection-id>/<connection-id>.data', format: 'cbor'
[Debug] SchemaFactory: Loaded 33 databases from storage for connection '<connection-id>'
[error] MSSQL: Error executing query on '<workspace-connection>', error: 'Invalid object name 'sys.pdw_table_distribution_properties'.'
Fabric connector (same target, no watchdog involvement, resolves in ~1s):
[info] Connection: opened '<lakehouse>' on '<workspace-connection>' (fabric:SQL Azure - 12.0.2000.8)
[error] MSSQL: Error executing query on '<workspace-connection>', error: 'DMV (Dynamic Management View) 'dm_db_partition_stats' is not supported.'
[Debug] SchemaFactory: Attempting to load schema from storage for '<lakehouse>' on connection '<connection-id>'
[Debug] [STUB] Skipping createDirectory for <globalStoragePath> (read-only mode)
[Debug] FileStore: Read file 'schemas/<connection-id>/<lakehouse>.data', bytes: 2812149
[Debug] FileStore: Parsed file 'schemas/<connection-id>/<lakehouse>.data', format: 'cbor'
[error] MSSQL: Error executing query on '<workspace-connection>', error: 'Invalid object name 'sys.pdw_table_distribution_properties'.'
[Debug] SchemaFactory: Loaded V2 schema from storage for '<lakehouse>' on connection '<connection-id>'
[Debug] SchemaFactory: Attempting to load databases from storage for connection '<connection-id>'
[Debug] FileStore: Read file 'schemas/<connection-id>/<connection-id>.data', bytes: 5154
[Debug] FileStore: Parsed file 'schemas/<connection-id>/<connection-id>.data', format: 'cbor'
[Debug] SchemaFactory: Loaded 33 databases from storage for connection '<connection-id>'
Bug Description
When connecting to a Fabric Lakehouse SQL Analytics Endpoint, schema introspection issues two queries that are not valid against this engine:
sys.dm_db_partition_stats— documented as unsupported on Synapse serverless SQL pool, and Fabric SQL endpoints share the same restricted surface.sys.pdw_table_distribution_properties— a PDW/dedicated-pool-only catalog view, also invalid here.Both fail and fall back to the cached schema.
This is observed using both the Fabric SQL Analytics Endpoint and Azure Synapse connectors.
Repro steps
.sqlscratch file / restore a previous session with one open.Expected behavior
fabricorazuresynapsedialect and skipssys.dm_db_partition_statsandsys.pdw_table_distribution_properties.Actual Behavior
activeStatementdeadline trips, logs aprobe-failed(timeout), aStopping server timed outerror, then force-recycles the language server process (recycle→sigkill). The connection recovers on the next generation, but this adds ~10+ seconds of stall and a full LS process kill/restart on every session that touches this connection.Environment
azuresynapse:SQL Azure - 12.0.2000.8fabric:SQL Azure - 12.0.2000.8Logs
Synapse connector:
Fabric connector (same target, no watchdog involvement, resolves in ~1s):