Skip to content

Access violation if fetching connections from pool in external_auth mode unless also specifying external_auth in get_with_options #106

Description

@ahjulstad

If creating a pool like this:

        let pool = PoolBuilder::new(username, password, connect_string)
            .max_connections(max_connections)
            .pool_type(PoolType::Heterogeneous)
            .external_auth(true)
            .build()
            .context("failed to create Oracle pool")?;

and then subsequently fetching connections from the pool without specifying external_auth in options like this:

            let opts = PoolOptions::new()
   //             .external_auth(true)   // omitting this
                .tag(tag.clone())
                .match_any_tag(true);
            let conn = pool
                .get_with_options(&opts)
                .context("failed to get Oracle connection from pool")?;

one gets STATUS_ACCESS_VIOLATION on windows (and segfaults on Linux) .. (with async , tokio = { version = "1.53.1", features = ["rt-multi-thread", "macros"], calling Oracle through spawn_blocking }

On Windows it would happen on the second retrieval from the pool, making it not really obvious what was wrong.

It could be that this is only something worth mentioning in the documentation.

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