Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - Deadlock issue when making multiple calls in WCF

 
 
Old 11-03-2007   #1 (permalink)
Jason Rodman


 
 

Deadlock issue when making multiple calls in WCF

I have a scenario where I use a self-hosted service that uses
NetTcpDuplexBinding. If my client app attempts to make a call to the service
while a callback is coming in from the service, i get a deadlock issue. I
thought that defining my service with ConcurrencyMode=Multiple would allow
this, but its just not working that way. Here is the exact message I am
getting:

System.InvalidOperationException: This operation would deadlock because the
reply cannot be received until the current Message completes processing. If
you want to allow out-of-order message processing, specify ConcurrencyMode of
Reentrant or Multiple on CallbackBehaviorAttribute.

I also have a need to be able to make one call from the client while another
is in progress, but I get this same issue. What can I do to allow this type
of behavior?

My System SpecsSystem Spec
Old 11-07-2007   #2 (permalink)
Joe-P


 
 

RE: Deadlock issue when making multiple calls in WCF

Hi Jason,
Did you try ConcurrencyMode=Rentrant instead of Multiple on
the client side? Since that seems to be the attribute needed in your
situation.


"Jason Rodman" wrote:
Quote:

> I have a scenario where I use a self-hosted service that uses
> NetTcpDuplexBinding. If my client app attempts to make a call to the service
> while a callback is coming in from the service, i get a deadlock issue. I
> thought that defining my service with ConcurrencyMode=Multiple would allow
> this, but its just not working that way. Here is the exact message I am
> getting:
>
> System.InvalidOperationException: This operation would deadlock because the
> reply cannot be received until the current Message completes processing. If
> you want to allow out-of-order message processing, specify ConcurrencyMode of
> Reentrant or Multiple on CallbackBehaviorAttribute.
>
> I also have a need to be able to make one call from the client while another
> is in progress, but I get this same issue. What can I do to allow this type
> of behavior?
My System SpecsSystem Spec
Old 11-07-2007   #3 (permalink)
Jason Rodman


 
 

RE: Deadlock issue when making multiple calls in WCF

Thanks for your reply Joe. From what I read about that mode, the service runs
in single threaded mode, which wont work for my scenario. I need to be able
to handle hundreds of concurrently connected users to the same service and be
able to service their requests in parallell. If i change this, the service
can only service one request at a time from what it sounds like. Am I
understanding this right?

"Joe-P" wrote:
Quote:

> Hi Jason,
> Did you try ConcurrencyMode=Rentrant instead of Multiple on
> the client side? Since that seems to be the attribute needed in your
> situation.
>
>
> "Jason Rodman" wrote:
>
Quote:

> > I have a scenario where I use a self-hosted service that uses
> > NetTcpDuplexBinding. If my client app attempts to make a call to the service
> > while a callback is coming in from the service, i get a deadlock issue. I
> > thought that defining my service with ConcurrencyMode=Multiple would allow
> > this, but its just not working that way. Here is the exact message I am
> > getting:
> >
> > System.InvalidOperationException: This operation would deadlock because the
> > reply cannot be received until the current Message completes processing. If
> > you want to allow out-of-order message processing, specify ConcurrencyMode of
> > Reentrant or Multiple on CallbackBehaviorAttribute.
> >
> > I also have a need to be able to make one call from the client while another
> > is in progress, but I get this same issue. What can I do to allow this type
> > of behavior?
My System SpecsSystem Spec
Old 11-08-2007   #4 (permalink)
Joe-P


 
 

RE: Deadlock issue when making multiple calls in WCF

Hi Jason,
Yeah you are right. Looks like you may want to use Asynchronous
mechanism. My recommendation would be to create the Asynchronus mechanism on
the service side therefore when the client makes the call it would seem its a
synchronous call. This way you are technically putting the message into a
queue depending on how many threads are available in the thread pool. If
there are enough available then the operation would be similar to regular
synchronus operation. Again, depending on your architecture you can have the
client initiating or service initiating the asynchronous call but this is an
option to prevent deadlock condition. To do it its easy and very little
coding on your part.

"Jason Rodman" wrote:
Quote:

> Thanks for your reply Joe. From what I read about that mode, the service runs
> in single threaded mode, which wont work for my scenario. I need to be able
> to handle hundreds of concurrently connected users to the same service and be
> able to service their requests in parallell. If i change this, the service
> can only service one request at a time from what it sounds like. Am I
> understanding this right?
>
> "Joe-P" wrote:
>
Quote:

> > Hi Jason,
> > Did you try ConcurrencyMode=Rentrant instead of Multiple on
> > the client side? Since that seems to be the attribute needed in your
> > situation.
> >
> >
> > "Jason Rodman" wrote:
> >
Quote:

> > > I have a scenario where I use a self-hosted service that uses
> > > NetTcpDuplexBinding. If my client app attempts to make a call to the service
> > > while a callback is coming in from the service, i get a deadlock issue. I
> > > thought that defining my service with ConcurrencyMode=Multiple would allow
> > > this, but its just not working that way. Here is the exact message I am
> > > getting:
> > >
> > > System.InvalidOperationException: This operation would deadlock because the
> > > reply cannot be received until the current Message completes processing. If
> > > you want to allow out-of-order message processing, specify ConcurrencyMode of
> > > Reentrant or Multiple on CallbackBehaviorAttribute.
> > >
> > > I also have a need to be able to make one call from the client while another
> > > is in progress, but I get this same issue. What can I do to allow this type
> > > of behavior?
My System SpecsSystem Spec
Old 12-01-2007   #5 (permalink)
MobileMan


 
 

RE: Deadlock issue when making multiple calls in WCF

Joes & Jason:

What about changing the InstanceMode to "PerCall" instead of using the
default? Would this take care of this issue?
--
Stay Mobile


"Joe-P" wrote:
Quote:

> Hi Jason,
> Yeah you are right. Looks like you may want to use Asynchronous
> mechanism. My recommendation would be to create the Asynchronus mechanism on
> the service side therefore when the client makes the call it would seem its a
> synchronous call. This way you are technically putting the message into a
> queue depending on how many threads are available in the thread pool. If
> there are enough available then the operation would be similar to regular
> synchronus operation. Again, depending on your architecture you can have the
> client initiating or service initiating the asynchronous call but this is an
> option to prevent deadlock condition. To do it its easy and very little
> coding on your part.
>
> "Jason Rodman" wrote:
>
Quote:

> > Thanks for your reply Joe. From what I read about that mode, the service runs
> > in single threaded mode, which wont work for my scenario. I need to be able
> > to handle hundreds of concurrently connected users to the same service and be
> > able to service their requests in parallell. If i change this, the service
> > can only service one request at a time from what it sounds like. Am I
> > understanding this right?
> >
> > "Joe-P" wrote:
> >
Quote:

> > > Hi Jason,
> > > Did you try ConcurrencyMode=Rentrant instead of Multiple on
> > > the client side? Since that seems to be the attribute needed in your
> > > situation.
> > >
> > >
> > > "Jason Rodman" wrote:
> > >
> > > > I have a scenario where I use a self-hosted service that uses
> > > > NetTcpDuplexBinding. If my client app attempts to make a call to the service
> > > > while a callback is coming in from the service, i get a deadlock issue. I
> > > > thought that defining my service with ConcurrencyMode=Multiple would allow
> > > > this, but its just not working that way. Here is the exact message I am
> > > > getting:
> > > >
> > > > System.InvalidOperationException: This operation would deadlock because the
> > > > reply cannot be received until the current Message completes processing. If
> > > > you want to allow out-of-order message processing, specify ConcurrencyMode of
> > > > Reentrant or Multiple on CallbackBehaviorAttribute.
> > > >
> > > > I also have a need to be able to make one call from the client while another
> > > > is in progress, but I get this same issue. What can I do to allow this type
> > > > of behavior?
My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
error making Video calls Live Messenger
Help! Reached a deadlock Vista security
How does Vista make making telephone calls any easier ?? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46