Skip to content

bug(indexer): Flaky test_optimistic_tables_pruning #9464

@tomxey

Description

@tomxey

Sometimes on CI the test fails with following error:

failures:

---- write_api::test_optimistic_tables_pruning stdout ----

thread 'tokio-runtime-worker' panicked at crates/iota-indexer/src/store/pg_indexer_store.rs:1720:9:
you are calling a blocking DB operation directly on an async thread. Please use IndexerReader::spawn_blocking instead to move the operation to a blocking thread
stack backtrace:

Which traces to the call to:

fn get_watermarks(&self) -> Result<(Vec<StoredWatermark>, i64), IndexerError> {
        // read_only transaction, otherwise this will block and get blocked by write
        // transactions to the same table.
        run_query_with_retry!(
            &self.blocking_cp,
            |conn| {
                ...
            },
            PG_DB_COMMIT_SLEEP_DURATION
        )
    }

But the function seems to be wrapped in a blocking task:

    async fn get_watermarks(&self) -> Result<(Vec<StoredWatermark>, i64), IndexerError> {
        self.execute_in_blocking_worker(move |this| this.get_watermarks())
            .await
    }

To be investigated what is the exact cause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructureIssues related to the Infrastructure Team

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions