Jump to content

Issues with P4 API (2017.2, 2018.3, 2018.4)

api .net dot net issues p4 delegate tagged sync parallel

  • Please log in to reply
No replies to this topic

#1 GEngines



  • Members
  • Pip
  • 1 posts

Posted 13 January 2019 - 05:58 AM


I have written a tool which would sync project data from perforce to local machine, This data size will be around 300 - 500 GB. I have tried using .NET API 2017.2, 2018.3 and 2018.4. But all of them seem to have issues.
Please note :  I have written this c# tool, learning c#, Please feel free to correct me if I have made any mistake in using the commands.

Issues are as follows :

1.   Losing Sync files info, If I upgrade API,
   I have added an option to show which file is currently being sync'd, as it shows in P4V client. I have achieved it using

P4Connection.TaggedOutputReceived += new P4Server.TaggedOutputDelegate(Connection_read_taggedOutput);

public void Connection_read_taggedOutput(uint cmdId, int objId, TaggedObject obj)
string data;

if (obj.TryGetValue("depotFile", out data))
OnDataTransfer("Syncing", data);

Sadly, this doesnt work if I use 2018.x  .net API.  

Please advise

2   Also, When I stick with 2017.2 API so that I get sync info correctly, It has a bug where when i run
			 IList<FileSpec> output = P4Connection.Client.SyncFiles(syncFlags, filesToSync.ToArray<FileSpec>());
More than once, the code gets stuck. It runs just fine when its being called only once,

Why am I running it more than once ?  - Well At first, its syncing data, and second iteration its syncing few dependency softwares to start some silent installation. As its getting stuck, I have written a custom api, which uses command line via c#. But I do not feel that's efficient enough as this. Since this gives more data which could come in handy.

This issue was resolved when I moved to 2018.3 or 2018.4 API, but It brought in a new issue, where the sync used to get stuck. never complete. Which again is inconsistent, So couldnt roll it out to the floor.

Please advise.

3.  Parallel Sync
  Saw that running parallel sync is cutting down the sync times by half, but is also very unstable and inconsistent, sometime it runs fine, but also just stops somewhere during the sync process.

Please advise.

This tool is meant to automate the entire project setup, Which seems to work fine, using 2017.2 but at the cost of time ( also couldn't run api sync command more than once), as downloading could be sped up using parallel sync, unfortunately due to the sync instability in newer apis couldn't go with it.

Could anyone please help me out!

Thanks in Advance.

- Bharath

Also tagged with one or more of these keywords: api, .net, dot, net, issues, p4, delegate, tagged, sync, parallel

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users