Skip to content

SetReadyBit concurrent writers can start nested SQLite transaction #2676

Description

@Widthdom

Summary

The PR #2661 pipeline failed on build (macos-latest, net9.0) because CodeIndex.Tests.ConcurrencyTests.SetReadyBit_ConcurrentWriters_DoNotLoseFlags intermittently throws:

Microsoft.Data.Sqlite.SqliteException : SQLite Error 1: 'cannot start a transaction within a transaction'.

The failing stack points to DbWriter.SetReadyBit calling raw BEGIN IMMEDIATE through Execute while SQLite already considers the connection to be in a transaction.

Observed CI

Expected

Concurrent ready-bit writers should serialize on the SQLite write lock without attempting a nested transaction on the same connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions