The text below is an attempt to expand and add color to this question:
How can I prevent a bad client from uninstalling the entire service?
I essentially have this scenario: the WCF service is up and running with a client callback that has a direct, simple, one-way message, not very different from this:
public interface IMyClientContract { [OperationContract(IsOneWay = true)] void SomethingChanged(simpleObject myObj); }
I call this method potentially thousands of times per second from the service until there will eventually be about 50 concurrently connected clients with minimal delay (<15 ms would be nice). This works fine until I set a breakpoint on one of the client applications connected to the server and then everything freezes after 2-5 seconds when the service freezes and no other clients receive any data for about 30 seconds or so long as the service logs a connection failure event and disconnects the intruder client. After that, all other clients continue to receive messages.
I did a study on configuring serviceThrottling, concurrency, setting minimum threadpool threads, secret WCF sauces and as many as 9 yards, but at the end of the day this MSDN article - basic WCF requirements, one-way calls, callbacks and events describe exactly the problem I encountered without making recommendations.
A third solution that allows the service to safely call the customer back is to set up callback operations as one-way operations. This allows the service to call back even when concurrency is configured to be single-threaded because there will be no response message to block.
but earlier in the article the problem that I see is described only from the point of view of the client
When one-way calls reach the service, they cannot be sent immediately and can be queued on the service side, which will be sent one at a time, all in accordance with the configured operation mode and concurrency mode session. How many messages (whether it is one-way or request-response) that the service wants to queue is the product of the configured channel and reliability mode. If the number of messages in the queue exceeds the bandwidth of the queue, the client will block even when a one-way call is issued
I can only assume that the opposite is true, the number of messages in the queue for the client has exceeded the bandwidth of the queue, and the threadpool is now full of threads trying to call this client, which are now blocked.
What is the right way to handle this? Should I explore a way to check how many messages are queued at the intercom level for each client and interrupt their connections after reaching a certain limit?
It seems that if the WCF service itself blocks the queue filling, then all the async / oneway / fire-and-forget strategies that I could ever implement inside the service will still be blocked whenever one client queue is full.