Skip to content

Conversation

@vkvikaskmr
Copy link

@vkvikaskmr vkvikaskmr commented Sep 25, 2017

UploadAction class, while uploading the file creates a reference and points to FileInfo object. This object stays in the heap even after the CopyFileItem method of class UploadAction goes out of scope. We cannot call dispose() method on FileInfo object as it does not implement IDispose interface. Hence we are calling Garbage Collector explicitly.

{
// File could not be deleted because it is locked.
// Calling Garbage collector explicitly to remove the object from the heap.
GC.Collect();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this actually solve the problem? Or is there a more fundamental issue with how the SDK is supporting parallel operations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked deeper into the code. Looks like the root cause is different. I will look further and update my findings here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't figure out the root cause. Here are few observations.

  • No issue with the completion of upload and starting of deletion logic. Verified this by putting a suitable wait after upload completes. This did not fix the problem.

  • I bypassed the parallel operations logic and performed upload right in the SyncSFItem.cs file. This too did not fix the problem.
    From these observations I felt that the issue is with uploaders object that we get from ShareFile.api.client library but when I looked into their code, there doesn't seem to be any problem. They are performing cleanups whenever possible.

Copy link
Contributor

@rgmills rgmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold for updates from @vkvikaskmr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants