Skip to content

Deadlock in WriteToServerAsync (possible reentrancy issue) #755

Closed
@coderb

Description

@coderb

(version nuget 4.7.0)

I'm not sure sure if you'll consider this a bug or by design, but there seems to be an inconsistency between the sync and async versions of bulk copy- WriteToServer and WriteToServerAsync.

When executing inside a transaction, the sync version WriteToServer allows for commands to be executed during the call to WriteToServer but prior to the first bulk inserted row.

When using the async version WriteToServerAsync if you try to execute a command even prior to the first row being sent it results in a deadlock (waiting on a semphore).

Unfortunately I'm porting a large amount of code to use async and this is going to be a big job to address. Is this something that you would consider addresing in SqlClient?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions