Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECSqlReader/ConcurrentQuery fail to prepare statement due to interrupted by query monitor. #7483

Open
khanaffan opened this issue Dec 13, 2024 · 1 comment
Assignees
Labels
ecdb ECDb and ECSQL related issues

Comments

@khanaffan
Copy link
Contributor

ECSqlReader/ConcurrentQuery fail to prepare statement due to interrupted by query monitor.

To Reproduce
Steps to reproduce the behavior:

Its flaky as its cause likely due to race condition. When a thread is running long running query and monitor like to interrupt it. But by the time monitor get to interrupt it, it is running a different query.

Its found in design review.

Expected behavior
No query should fail during Prepare phase.

Here is response
101 mean fail to prepare
Error in there show it failed because of being interrupted.

{
  "kind": 2,
  "error": "Preparing the ECSQL 'select * from (select distinct name from meta.ecPropertyDef where ec_classname(class.id) in (\n          select distinct ec_classname(ecclassid) from bis.geometricElement3d ge)) limit :sys_ecdb_count offset :sys_ecdb_offset' failed. Underlying SQLite statement failed to prepare: BE_SQLITE_INTERRUPT interrupted (BE_SQLITE_INTERRUPT) [SQL: SELECT [K0] FROM (SELECT DISTINCT [ecPropertyDef].[Name] [K0] FROM (SELECT [Id] ECInstanceId,37 ECClassId,[ClassId],[Name] FROM [main].[ec_Property]) [ecPropertyDef] WHERE ec_classname([ecPropertyDef].[ClassId]) IN (SELECT DISTINCT ec_classname([ge].[ECClassId]) FROM (SELECT [bis_GeometricElement3d].[ElementId] ECInstanceId,[bis_GeometricElement3d].[ECClassId] FROM [main].[bis_GeometricElement3d]) [ge]))  LIMIT :sys_ecdb_count_col1 OFFSET :sys_ecdb_offset_col1]",
  "status": 101,
  "stats": {
    "cpuTime": 1064,
    "totalTime": 2,
    "timeLimit": 60000,
    "memLimit": 8388608,
    "memUsed": 0
  }
}

Desktop (please complete the applicable information):

  • OS: windows
  • Browser: Chrome
  • iTwin.js Version 4.x

Its flaky due to race condition. Though this can be easy to generated with a sending long running query (That require to be interrupted) and also quick running queries.

@khanaffan khanaffan self-assigned this Dec 13, 2024
@khanaffan khanaffan added the ecdb ECDb and ECSQL related issues label Dec 13, 2024
@khanaffan
Copy link
Contributor Author

@glenworrall here is the issue i logged based on info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecdb ECDb and ECSQL related issues
Projects
None yet
Development

No branches or pull requests

1 participant