Thread: [simias-svn] SF.net SVN: simias:[7359] trunk/src/core/Sync/SyncClient.cs
Brought to you by:
srinidhi_bs
|
From: <jj...@us...> - 2010-05-10 10:46:06
|
Revision: 7359
http://simias.svn.sourceforge.net/simias/?rev=7359&view=rev
Author: jjohnny
Date: 2010-05-10 10:46:00 +0000 (Mon, 10 May 2010)
Log Message:
-----------
ID: Bug #541317
Reviewers: Ramesh
Localization Required: No
Documentation Required: No
Description: Modifications of ReadOnly, shared, iFolders are not poping messages from client
Removed code that adds extra nodes to workarray when the ifolder is readonly. It was causing a false conflict.
Modified Paths:
--------------
trunk/src/core/Sync/SyncClient.cs
Modified: trunk/src/core/Sync/SyncClient.cs
===================================================================
--- trunk/src/core/Sync/SyncClient.cs 2010-05-07 11:24:44 UTC (rev 7358)
+++ trunk/src/core/Sync/SyncClient.cs 2010-05-10 10:46:00 UTC (rev 7359)
@@ -3102,48 +3102,40 @@
/// <param name="stamp">The SyncNodeStamp describing this node.</param>
internal void AddNodeToServer(SyncNodeInfo stamp)
{
+ //Nodes have changed.
if (stamp.MasterIncarnation != stamp.LocalIncarnation)
{
if (rights == Access.Rights.ReadOnly)
{
- // If this node exists on the server.
- if (stamp.MasterIncarnation != 0)
+ // If there is a change, by policy we don't sync
+ // if it is a newly created node or a existing file
+ // So just emit a event for client
+ Node tNode = collection.GetNodeByID(stamp.ID);
+ if (tNode != null)
{
- // We need to get this node from the server.
- stamp.Operation = SyncOperation.Change;
- stamp.LocalIncarnation = stamp.MasterIncarnation + 1;
- AddNodeFromServer(stamp);
- }
- else
- {
- Node tNode = collection.GetNodeByID(stamp.ID);
- if (tNode != null)
+ if (stamp.Operation == SyncOperation.Delete)
{
-
- if (stamp.Operation == SyncOperation.Delete)
+ // Since this is a delete just delete the tombstone.
+ collection.Delete(tNode);
+ collection.Commit(tNode);
+ }
+ else
+ {
+ ObjectType type;
+ switch (stamp.NodeType)
{
- // Since this is a delete just delete the tombstone.
- collection.Delete(tNode);
- collection.Commit(tNode);
+ case SyncNodeType.Directory:
+ type = ObjectType.Directory;
+ break;
+ case SyncNodeType.File:
+ type = ObjectType.File;
+ break;
+ default:
+ type = ObjectType.Unknown;
+ break;
}
- else
- {
- ObjectType type;
- switch (stamp.NodeType)
- {
- case SyncNodeType.Directory:
- type = ObjectType.Directory;
- break;
- case SyncNodeType.File:
- type = ObjectType.File;
- break;
- default:
- type = ObjectType.Unknown;
- break;
- }
- eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, type, false, tNode.Name, 0, 0, 0, Direction.Uploading, SyncStatus.ReadOnly));
- Log.log.Debug("Failed Uploading Node (ReadOnly rights)");
- }
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, type, false, tNode.Name, 0, 0, 0, Direction.Uploading, SyncStatus.ReadOnly));
+ Log.log.Debug("Failed Uploading Node (ReadOnly rights)");
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2010-08-27 03:50:31
|
Revision: 7497
http://simias.svn.sourceforge.net/simias/?rev=7497&view=rev
Author: spkumar
Date: 2010-08-27 03:50:24 +0000 (Fri, 27 Aug 2010)
Log Message:
-----------
D: #424645
Reviewer: Vikash
Localization Required: No
Documentation Required: No
Description: Fixed an issue while uploading large number of files from
Linux client
Modified Paths:
--------------
trunk/src/core/Sync/SyncClient.cs
Modified: trunk/src/core/Sync/SyncClient.cs
===================================================================
--- trunk/src/core/Sync/SyncClient.cs 2010-08-26 08:00:36 UTC (rev 7496)
+++ trunk/src/core/Sync/SyncClient.cs 2010-08-27 03:50:24 UTC (rev 7497)
@@ -273,9 +273,10 @@
if (col.EncryptionAlgorithm != null && col.EncryptionAlgorithm != string.Empty)
SyncClient.ScheduleSync(col.ID);
}
- catch (Exception e)
+ catch (Exception ex)
{
log.Debug("RescheduleAllEncryptedColSync: Error scheduling {0} for sync.", sn.ID);
+ log.Debug("Exception.Message: {0}, StackTrace: {1}", ex.Message, ex.StackTrace);
}
}
}
@@ -704,7 +705,6 @@
SyncWorkArray workArray;
Store store;
public Collection collection;
- bool queuedChanges;
bool serverAlive = true;
bool CollSyncStatus = true;
StartSyncStatus serverStatus;
@@ -719,7 +719,7 @@
private const string ServerCLContextProp = "ServerCLContext";
private const string ClientCLContextProp = "ClientCLContext";
private Object syncObject = new Object();
- int nodesToSync = 0;
+
static int initialSyncDelay = 10 * 1000; // 10 seconds.
DateTime syncStartTime; // Time stamp when sync was called.
const int timeSlice = 3; //Timeslice in minutes.
@@ -1077,7 +1077,6 @@
eventPublisher.RaiseEvent(new CollectionSyncEventArgs(collection.Name, collection.ID, Simias.Client.Event.Action.StartLocalSync, true, false));
syncStartTime = DateTime.Now;
- queuedChanges = false;
running = true;
bool isNewifolder = false;
serverStatus = StartSyncStatus.Success;
@@ -1279,7 +1278,6 @@
bool moreEntries = false;
while (true)
{
- int filesFromServer;
if (!si.ChangesOnly)
{
// We don't have any state. So do a full sync.
@@ -1302,10 +1300,8 @@
cstamps = null;
}
- filesFromServer = workArray.DownCount + workArray.MergeCount;
-
+
// we are not queuing anymore as we expect all to be done once started
- //queuedChanges = true;
if (!ServerIs36())
AddMemberNodeFromServer();
@@ -1539,7 +1535,6 @@
public bool CheckForUserMovement(string NewHostID, string UserID, string DomainID)
{
- string collectionID = collection.ID;
string OldHostID = collection.HostID;
bool CollectionMoved = false;
bool UserMovementUpdationDone = false;
@@ -2015,7 +2010,6 @@
{
Domain domain = null;
Member currentMember = null;
- bool isDomainSync = false;
string ColType = collection.GetType().ToString();
@@ -2036,7 +2030,7 @@
if (IsDomainType && !Store.IsEnterpriseServer)
{
- isDomainSync = true;
+
currentMember = domain.GetCurrentMember();
Node memberNode = collection.GetNodeByID(currentMember.UserID);
@@ -2062,7 +2056,6 @@
/// </summary>
private void ExecuteSync()
{
- nodesToSync = workArray.Count;
if (workArray.MergeCount != 0)
{
// Get the updates from the server.
@@ -2875,6 +2868,7 @@
string[] nodeIDs = workArray.FilesToServer();
if (nodeIDs.Length == 0)
return;
+ BaseFileNode node = null;
log.Info("Uploading {0} Files To server", nodeIDs.Length);
@@ -2886,8 +2880,7 @@
{
return;
}
-
- BaseFileNode node = collection.GetNodeByID(nodeID) as BaseFileNode;
+ node = collection.GetNodeByID(nodeID) as BaseFileNode;
if (node != null)
{
if (collection.HasCollisions(node))
@@ -2983,7 +2976,7 @@
}
catch (FileNotFoundException excep)
{
- Log.log.Debug(excep, "Failed Uploading File, FileNotFoundException");
+ Log.log.Debug(excep, "Failed Uploading File, FileNotFoundException");
// The file no longer exists. this line added for 344792
workArray.RemoveNodeToServer(nodeID);
@@ -2992,18 +2985,40 @@
}
catch (WebException we)
{
- //This is to handle any webException while performing upload/download and
+ //This is to handle any webException while performing upload and
//not to remove node from workarray in this case
//if required,To remove, check the error message explicitly
- Log.log.Debug(we, "Failed Uploading File, WebException");
+ Log.log.Debug(we, "Failed Uploading File, WebException");
+ if( node != null) {
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, ObjectType.File, false, node.GetFullPath(collection), 0, 0, 0, Direction.Uploading, SyncStatus.Error));
+ } else {
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, ObjectType.File, false, nodeID, 0, 0, 0, Direction.Uploading, SyncStatus.Error));
+ }
}
- catch (ArgumentOutOfRangeException Aex)
+ catch (IOException ioe)
{
- Log.log.Debug(string.Format("ArgumentOutOfRangeException with message :{0} and stacktrace: {1}",Aex.Message, Aex.StackTrace));
+ //This is to handle any IOException while performing upload and
+ //not to remove node from workarray in this case
+ //if required, To remove, check the error message explicitly
+ Log.log.Debug(ioe, "Failed Uploading File, IOException");
+ if( node != null) {
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, ObjectType.File, false, node.GetFullPath(collection), 0, 0, 0, Direction.Uploading, SyncStatus.Error));
+ } else {
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, ObjectType.File, false, nodeID, 0, 0, 0, Direction.Uploading, SyncStatus.Error));
+ }
}
+ catch (ArgumentOutOfRangeException Aex)
+ {
+ Log.log.Debug(string.Format("ArgumentOutOfRangeException with message :{0} and stacktrace: {1}",Aex.Message, Aex.StackTrace));
+ if( node != null) {
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, ObjectType.File, false, node.GetFullPath(collection), 0, 0, 0, Direction.Uploading, SyncStatus.Error));
+ } else {
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, ObjectType.File, false, nodeID, 0, 0, 0, Direction.Uploading, SyncStatus.Error));
+ }
+ }
catch (Exception ex)
{
- workArray.RemoveNodeToServer(nodeID);
+ workArray.RemoveNodeToServer(nodeID);
Log.log.Debug(ex, "Failed Uploading File");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mv...@us...> - 2010-10-20 08:59:18
|
Revision: 7533
http://simias.svn.sourceforge.net/simias/?rev=7533&view=rev
Author: mvikash
Date: 2010-10-20 08:59:12 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
updating filemonitor.scanthread status as false, when scanthread is null.
Modified Paths:
--------------
trunk/src/core/Sync/SyncClient.cs
Modified: trunk/src/core/Sync/SyncClient.cs
===================================================================
--- trunk/src/core/Sync/SyncClient.cs 2010-10-19 05:45:56 UTC (rev 7532)
+++ trunk/src/core/Sync/SyncClient.cs 2010-10-20 08:59:12 UTC (rev 7533)
@@ -1150,7 +1150,7 @@
{
if(isNewifolder == true)
{
- log.Debug("new iFolder start the scan thread");
+ log.Debug("new iFolder start the scan thread");
scanThread = new Thread(new ThreadStart(fileMonitor.CheckForFileChanges));
scanThread.IsBackground = true;
scanThread.Priority = ThreadPriority.BelowNormal;
@@ -1790,7 +1790,14 @@
// doing atomic
lock (fileMonitor)
{
- scanThreadStatus = fileMonitor.scanThreadRunning;
+
+ if (scanThread == null || scanThread.IsAlive == false)
+ {
+ fileMonitor.scanThreadRunning = false;
+ }
+
+ scanThreadStatus = fileMonitor.scanThreadRunning;
+
}
if(scanThreadStatus == false)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mv...@us...> - 2011-08-03 14:17:08
|
Revision: 7610
http://simias.svn.sourceforge.net/simias/?rev=7610&view=rev
Author: mvikash
Date: 2011-08-03 14:17:02 +0000 (Wed, 03 Aug 2011)
Log Message:
-----------
ID: #665552
Reviewer: GG, Pratima
Localization Required: No
Documentation Required: No
Description:- iFolder with path length over 260 char has been handled.
Modified Paths:
--------------
trunk/src/core/Sync/SyncClient.cs
Modified: trunk/src/core/Sync/SyncClient.cs
===================================================================
--- trunk/src/core/Sync/SyncClient.cs 2011-07-21 22:13:31 UTC (rev 7609)
+++ trunk/src/core/Sync/SyncClient.cs 2011-08-03 14:17:02 UTC (rev 7610)
@@ -2456,13 +2456,14 @@
/// <returns>ture if successful.</returns>
private bool StoreDir(SyncNode snode, bool merge)
{
+ DirNode node = null;
try
{
if (snode.node != null && snode.node.Length != 0)
{
XmlDocument xNode = new XmlDocument();
xNode.LoadXml(snode.node);
- DirNode node = (DirNode)Node.NodeFactory(store, xNode);
+ node = (DirNode)Node.NodeFactory(store, xNode);
log.Info("Importing Directory {0} from server", node.Name);
Import(node);
@@ -2571,6 +2572,13 @@
workArray.RemoveNodeFromServer(snode.ID, merge);
return true;
}
+ catch (PathTooLongException pax)
+ {
+ if(node != null)
+ eventPublisher.RaiseEvent(new FileSyncEventArgs(collection.ID, ObjectType.File, false, node.Name, 0, 0, 0, Direction.Downloading, SyncStatus.PathTooLong));
+ log.Debug("SyncClient.cs: path too long exception for collectionid : " + snode.ID + pax.StackTrace );
+ return false;
+ }
catch
{
log.Debug("SyncClient.cs: caught exception inside StoreDir for collectionid : "+snode.ID);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|