Skip to content

Is there a CodeQL command-line parameter to specify the cache directory path to allow concurrent query execution? #21077

@xuwangcheng14

Description

@xuwangcheng14

We are currently attempting to build a complete QL analysis database (including all historical code) based on CodeQL, and provide colleagues with one-click query capabilities via a web interface. However, we encountered a critical limitation: CodeQL cannot execute the codeql query run command concurrently on the same database, resulting in conflicts.

From the error message, we understand that CodeQL performs a lock check on the .lock file located in the database's default/cache/ directory before executing the codeql query run command. This lock mechanism prevents multiple instances from accessing the same cache directory simultaneously.

Is there a command-line parameter in CodeQL to customize the cache directory path for each query execution, thereby avoiding conflicts caused by concurrent queries? This would allow us to bypass the default locking mechanism.

Execution Command

{qlExecPath} query run -d {databasePath} {scriptPath} --threads=8 --output={resultFileName}.bqrs

Error Message

A fatal error occurred: Error initializing the IMB disk cache: the cache directory is already locked by another running process. 
Only one instance of the IMB can access a cache directory at a time. 
The lock file is located at \DTMP\local\databaseaf71736a521a444392b22b6f4be4a28a\java\db-java\default\cache\.lock
(eventual cause: OverlappingFileLockException)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions