Deadlock when executing multiple select statements from multiple threads

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Deadlock when executing multiple select statements from multiple threads

Ayman Samamry

Hello,

 

We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version (9.6.4.0) or newer, doesn’t happen on 9.6.3.1 .

I’ve attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].

I’ve also included the stack trace of the two threads in deadlock.

 

Regards,

Ayman


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________

MultithreadedSelectDeadlock.zip (193K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Deadlock when executing multiple select statements from multiple threads

Inoue, Hiroshi-2
Hi Ayman,

Thanks for the report.
I would examine the issue.

regards,
Hiroshi Inoue

On 2018/04/10 14:51, Ayman Samamry wrote:

Hello,

 

We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version (9.6.4.0) or newer, doesn’t happen on 9.6.3.1 .

I’ve attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].

I’ve also included the stack trace of the two threads in deadlock.

 

Regards,

Ayman


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Deadlock when executing multiple select statements from multiple threads

Inoue, Hiroshi-2
Hi,

On 2018/04/11 12:03, Inoue, Hiroshi wrote:
Hi Ayman,

Thanks for the report.
I would examine the issue.

Could you please try the test drivers 10.02.0100 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue


regards,
Hiroshi Inoue

On 2018/04/10 14:51, Ayman Samamry wrote:

Hello,

 

We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version (9.6.4.0) or newer, doesn’t happen on 9.6.3.1 .

I’ve attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].

I’ve also included the stack trace of the two threads in deadlock.

 

Regards,

Ayman


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

RE: Deadlock when executing multiple select statements from multiple threads

Ayman Samamry

Hi,

 

The deadlock with the ‘select’ statement is fixed, however it seems that the  other operations (update/insert/delete) still cause a similar deadlock too…(can be easily reproduced if you replace the selects with any of the other operations).

Regards,

Ayman

 

From: Inoue, Hiroshi [mailto:[hidden email]]
Sent: Friday, April 13, 2018 6:52 PM
To: Ayman Samamry <[hidden email]>
Cc: [hidden email]; Henry Santosa <[hidden email]>; Denn Sporcic <[hidden email]>
Subject: Re: Deadlock when executing multiple select statements from multiple threads

 

Hi,

On 2018/04/11 12:03, Inoue, Hiroshi wrote:

Hi Ayman,

Thanks for the report.
I would examine the issue.


Could you please try the test drivers 10.02.0100 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue



regards,
Hiroshi Inoue

On 2018/04/10 14:51, Ayman Samamry wrote:

Hello,

 

We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version (9.6.4.0) or newer, doesn’t happen on 9.6.3.1 .

I’ve attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].

I’ve also included the stack trace of the two threads in deadlock.

 

Regards,

Ayman


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________


_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed
Scanning Services - powered by MessageLabs. For further information
visit http://www.mci.com


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Deadlock when executing multiple select statements from multiple threads

Inoue, Hiroshi-2
Hi,

On 2018/04/16 9:41, Ayman Samamry wrote:

Hi,

 

The deadlock with the ‘select’ statement is fixed, however it seems that the  other operations (update/insert/delete) still cause a similar deadlock too…(can be easily reproduced if you replace the selects with any of the other operations).


Could you please retry the test drivers 10.02.0101 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue

Regards,

Ayman

 

From: Inoue, Hiroshi [[hidden email]]
Sent: Friday, April 13, 2018 6:52 PM
To: Ayman Samamry [hidden email]
Cc: [hidden email]; Henry Santosa [hidden email]; Denn Sporcic [hidden email]
Subject: Re: Deadlock when executing multiple select statements from multiple threads

 

Hi,

On 2018/04/11 12:03, Inoue, Hiroshi wrote:

Hi Ayman,

Thanks for the report.
I would examine the issue.


Could you please try the test drivers 10.02.0100 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue



regards,
Hiroshi Inoue

On 2018/04/10 14:51, Ayman Samamry wrote:

Hello,

 

We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version (9.6.4.0) or newer, doesn’t happen on 9.6.3.1 .

I’ve attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].

I’ve also included the stack trace of the two threads in deadlock.

 

Regards,

Ayman


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________


_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed
Scanning Services - powered by MessageLabs. For further information
visit http://www.mci.com


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

RE: Deadlock when executing multiple select statements from multiple threads

Ayman Samamry

Hi , this seems to be working fine.

 

Thanks,

Ayman

 

From: Inoue, Hiroshi [mailto:[hidden email]]
Sent: Monday, April 16, 2018 8:49 PM
To: Ayman Samamry <[hidden email]>
Cc: [hidden email]; Henry Santosa <[hidden email]>; Denn Sporcic <[hidden email]>
Subject: Re: Deadlock when executing multiple select statements from multiple threads

 

Hi,

On 2018/04/16 9:41, Ayman Samamry wrote:

Hi,

 

The deadlock with the ‘select’ statement is fixed, however it seems that the  other operations (update/insert/delete) still cause a similar deadlock too…(can be easily reproduced if you replace the selects with any of the other operations).


Could you please retry the test drivers 10.02.0101 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue


Regards,

Ayman

 

From: Inoue, Hiroshi [[hidden email]]
Sent: Friday, April 13, 2018 6:52 PM
To: Ayman Samamry [hidden email]
Cc: [hidden email]; Henry Santosa [hidden email]; Denn Sporcic [hidden email]
Subject: Re: Deadlock when executing multiple select statements from multiple threads

 

Hi,

On 2018/04/11 12:03, Inoue, Hiroshi wrote:

Hi Ayman,

Thanks for the report.
I would examine the issue.


Could you please try the test drivers 10.02.0100 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue




regards,
Hiroshi Inoue

On 2018/04/10 14:51, Ayman Samamry wrote:

Hello,

 

We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version (9.6.4.0) or newer, doesn’t happen on 9.6.3.1 .

I’ve attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].

I’ve also included the stack trace of the two threads in deadlock.

 

Regards,

Ayman


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________


_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed
Scanning Services - powered by MessageLabs. For further information
visit http://www.mci.com


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
______________________________________________________________________


_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed
Scanning Services - powered by MessageLabs. For further information
visit http://www.mci.com


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

RE: Deadlock when executing multiple select statements from multiple threads

Denn Sporcic
In reply to this post by Inoue, Hiroshi-2
Thanks Hiroshi ! 


From: Inoue, Hiroshi [[hidden email]]
Sent: Monday, April 16, 2018 8:48 PM
To: Ayman Samamry
Cc: [hidden email]; Henry Santosa; Denn Sporcic
Subject: Re: Deadlock when executing multiple select statements from multiple threads

Hi,

On 2018/04/16 9:41, Ayman Samamry wrote:

Hi,

 

The deadlock with the ‘select’ statement is fixed, however it seems that the  other operations (update/insert/delete) still cause a similar deadlock too…(can be easily reproduced if you replace the selects with any of the other operations).


Could you please retry the test drivers 10.02.0101 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue

Regards,

Ayman

 

From: Inoue, Hiroshi [[hidden email]]
Sent: Friday, April 13, 2018 6:52 PM
To: Ayman Samamry [hidden email]
Cc: [hidden email]; Henry Santosa [hidden email]; Denn Sporcic [hidden email]
Subject: Re: Deadlock when executing multiple select statements from multiple threads

 

Hi,

On 2018/04/11 12:03, Inoue, Hiroshi wrote:

Hi Ayman,

Thanks for the report.
I would examine the issue.


Could you please try the test drivers 10.02.0100 on Windows at
    https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue



regards,
Hiroshi Inoue

On 2018/04/10 14:51, Ayman Samamry wrote:

Hello,

 

We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version (9.6.4.0) or newer, doesn’t happen on 9.6.3.1 .

I’ve attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].

I’ve also included the stack trace of the two threads in deadlock.

 

Regards,

Ayman


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________


_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed
Scanning Services - powered by MessageLabs. For further information
visit http://www.mci.com


_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
______________________________________________________________________

_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed
Scanning Services - powered by MessageLabs. For further information
visit http://www.mci.com

_____________________________________________________________________

This email, including any attachments, is confidential and/or privileged. If you are not the intended recipient, any use for any purpose or disclosure its contents to any other person or copying of this Email is strictly prohibited; please notify us immediately by return email or telephone +61 2 9966 1066 and destroy the original message. IR entities reserve the right to monitor all email communications through their networks.
_______________________________________________________________________