Timeout task in a distributed transaction over WCF binding net.tcp

I have a weird timeout problem when starting a distributed transaction over WCF net.tcp binding. A deal always ends after exactly 10 minutes. I think I set all the timeouts that I know with a higher cost than this (15 minutes), but I'm probably missing something. I call the WCF service net.tcp hosted in IIS7.5.

On the service side, I have the following binding configuration:

<binding name="OrgSyncService_NetTcpBinding" portSharingEnabled="true"
         transactionFlow="true" maxReceivedMessageSize="1048576000"
         openTimeout="00:01:00" receiveTimeout="00:15:00" sendTimeout="00:15:00">
    <security mode="Transport">
        <transport clientCredentialType="Windows"
                   protectionLevel="EncryptAndSign"/>
    </security>
    <readerQuotas maxStringContentLength="1073741824" />
    <reliableSession enabled="true" inactivityTimeout="00:15:00" />
</binding>

As you can see, all relevant timeouts are 15 minutes. On the client side, the binding configuration is as follows:

<binding name="NetTcpBinding_OrgSyncService" closeTimeout="00:01:00"
         openTimeout="00:01:00" receiveTimeout="00:15:00" sendTimeout="00:15:00"
         transactionFlow="true" transferMode="Buffered"
         transactionProtocol="OleTransactions"
         hostNameComparisonMode="StrongWildcard" listenBacklog="10"
         maxBufferPoolSize="524288" maxConnections="10"
         maxReceivedMessageSize="1048576000">
    <readerQuotas maxDepth="32" maxStringContentLength="1073741824"
                  maxArrayLength="16384" maxBytesPerRead="4096"
                  maxNameTableCharCount="16384" />
    <reliableSession ordered="true" inactivityTimeout="00:15:00" enabled="true" />
    <security mode="Transport">
        <transport clientCredentialType="Windows"
                   protectionLevel="EncryptAndSign" />
        <message clientCredentialType="Windows" />
    </security>
</binding>

Again, all the timeouts that I know of are set to 15 minutes. Finally, the code that starts the transaction:

var options = new TransactionOptions
{
    IsolationLevel = IsolationLevel.ReadCommitted,
    Timeout = TimeSpan.FromMinutes(15)
};
using (var ts = new TransactionScope(TransactionScopeOption.Required, options))
{
    // Do transactional work.
    // Call web service.
    service.HandleSourceChanges(listOfChanges);
    ts.Complete();
}

The web service method itself has the following signature:

[OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
public void HandleSourceChanges(IEnumerable<OrgSyncSourceChange> sourceChanges)
{ /* Handle changes and store them in the database. */ }

, , 10 , . , . , - .

? IIS, ? MSDTC?

+3
2

. machine.config. system.transaction - 10 . - -.

machine.config ( C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config), -.

<system.transactions>
    <machineSettings maxTimeout="00:15:00" />
</system.transactions>

15 .

+4

IIS? , ?

0

Source: https://habr.com/ru/post/1778692/


All Articles