100MB Database Sync Issues

Jun 26, 2014 at 11:37 PM
I am currently trying to sync an extremely large database (100 MB) and it keeps failing no matter what I try. The error I got is below:
"The underlying connection was closed: An unexpected error occurred on a receive."
I have tried to change the ServicePointManager.MaxServicePointIdleTime on the server as well as the IIS connection timeout (I changed it to 16 minutes and the sync fails with the error in under 13 minutes) but nothing seems to work. Any ideas?
Coordinator
Jun 30, 2014 at 3:17 PM
Do you have enabled batch mode on the server side config ?
 // Because my json may be huge, i enable the batch mode
            config.SetDownloadBatchSize(2 * 1024);
Jun 30, 2014 at 6:02 PM
Yeah, I have that exact code in my server config
Coordinator
Jul 1, 2014 at 8:22 AM
Well, that's strange....
Can you send me a repro to be able to reproduce your problem ?
Jul 7, 2014 at 11:39 PM
Here are the sanitized web.config and SyncService.svc.cs files:

SyncService.svc.cs:
using Microsoft.Synchronization.Services;
using System.Configuration;
namespace FDA {
    
    #region SyncService: Configuration and setup
    public class FDASyncService : Microsoft.Synchronization.Services.SyncService<FDAOfflineEntities> {
        
        public static void InitializeService(Microsoft.Synchronization.Services.ISyncServiceConfiguration config) {
            // Connection string from web.config
            config.ServerConnectionString = ConfigurationManager.ConnectionStrings["lar-sv-db01"].ConnectionString;

            // The scope to use
            config.SetEnableScope("FDA");
            config.AddFilterParameterConfiguration("VegCollectionData_ID", "VegCollectionData", "@VegCollectionData_ID", typeof(System.Guid));
            config.AddFilterParameterConfiguration("Visit_ID", "Visit", "@Visit_ID", typeof(System.Guid));
            config.AddFilterParameterConfiguration("Picture_ID", "Picture", "@Picture_ID", typeof(System.Guid));
            config.AddFilterParameterConfiguration("QualVegCollectionData_ID", "QualVegCollectionData", "@QualVegCollectionData_ID", typeof(System.Guid));
            // I want to discuss with the JSON format ODataJson
            config.SetDefaultSyncSerializationFormat(SyncSerializationFormat.ODataJson);

            // The server is always true
            config.SetConflictResolutionPolicy(ConflictResolutionPolicy.ClientWins);

            // for debug purpose, I need the whole error details
            config.UseVerboseErrors = true;

            // Because my json may be huge, i enable the batch mode
            config.SetDownloadBatchSize(2 * 2024);

            //ServicePointManager.MaxServicePointIdleTime = 20 * 60 * 1000;
            //ServicePointManager.Expect100Continue = false;
        }
    }
    #endregion
}
web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />

    <httpRuntime targetFramework="4.5"/>
  </system.web>
  
    <connectionStrings>
        <add name="lar-sv-db01" connectionString="Data Source=myservice.myserver.com;Initial Catalog=VegetationSyncdb;User Id=myUser;Password=MyPass;" />
    </connectionStrings>
    
    <system.webServer>
            <defaultDocument>
            <files>
                        <add value="fdasyncservice.svc" />
            </files>
            </defaultDocument>


        <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="524288000"/>
      </requestFiltering>
    </security>

    <validation validateIntegratedModeConfiguration="false" />
    <asp>
      <limits maxRequestEntityAllowed="2147483647" bufferingLimit="2147483647" />
    </asp>


    </system.webServer>


    <system.serviceModel>
        <bindings>
           <webHttpBinding>
            <binding closeTimeout="00:20:00" openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"  />
           </webHttpBinding>
        </bindings>
    </system.serviceModel>

</configuration>
Coordinator
Jul 8, 2014 at 9:37 AM
It's ok in my point of view

I