Skip to content

Specifying 'QueryTimeout' issues a LOCK_TIMEOUT on the server #1027

@gjdanis

Description

@gjdanis

In the pdo_sqlsrv and sqlsrv drivers it looks like setting 'QueryTimeout' actually issues a LOCK_TIMEOUT command on the server. Here's an example with PDO:

$pdo = new PDO(...);
$pdo->setAttribute(PDO::SQLSRV_ATTR_QUERY_TIMEOUT, 30);
$pdo->exec(
  '
    WAITFOR DELAY \'00:00:40\'; SELECT 1
  '
);

This likely isn't what we want as read queries that don't take any locks and exceed this timeout won't be killed.

Is there a recommended approach to ensure that read queries don't exceed a user specified query timeout?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions