none
How to automatically cancel WCF job after client disconnects? RRS feed

  • Question

  • I'm running some benchmarks as jobs (using WCF/SOA) that require a lot of resources.

    If the benchmark client crashes, the benchmark job keeps running and occupying those resources; moreover, it seems to keep running for much longer than all the timeouts in my SessionStartInfo. I have to cancel the job in HPC Cluster Manager.

    I'd like the benchmark job to be automatically canceled when the WCF session is disconnected.

    How can that be done?

    Monday, June 14, 2010 10:45 AM

Answers

  • Hi Eugene,

    Which version of HPC cluster you are using? 2008 or 2008R2?

    And which binding you are using? Net.tcp binding by default or http binding? If you are using http binding, there might be extra timeout due to the nature of detecting http connection timeout.

    If you are using net.tcp binding, the session should be close after the session idle timeout. You can set this by either change session start info, or edit the service registration file directly (assuming you are using HPC 2008 R2).

    Also, I would suggest to add Session.Close() call in a final block to make sure your client close the session due to some uncatched exception.

    -yiding

    Sunday, June 20, 2010 12:19 AM