Bug 232 - VCM UI + CVS: multiple round trips caused by API client (1GIZ4I8)
Summary: VCM UI + CVS: multiple round trips caused by API client (1GIZ4I8)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 13422 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 21:38 EDT by Jean-Michel Lemieux CLA
Modified: 2002-04-23 11:32 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Michel Lemieux CLA 2001-10-10 21:38:37 EDT
A user of the VCM API can easily call API methods, that cause a round trip, within a loop. This
can potentialy result in multiple connections to the repository in a short period of time.

For example:

	IFileEdition[] editions;
	for(int i = 0; i < editions.length; i++) {
		InputStream is = editions[i].fetchContent(null); 
	}

Our current API does not allow the client of the API to help the adapters batch round trips
(e.g. of course if the adapter can implement batching within a connection). We will need a IVCMRunnable interface such that the following code could be
written:

VCMAdapter.run( new IVCMRunnable() {
		public void run(IProgressMonitor monitor) {
			IFileEdition[] editions;
			for(int i = 0; i < editions.length; i++) {
				InputStream is = editions[i].fetchContent(null); 
		}
	}

The adapter could have the opportunity to setup a connection to run batch VCM operations:

public void run(IVCMRunnable job, IProgressMonitor monitor) throwsVCMException {
	monitor = Policy.monitorFor(monitor);
	try {
		monitor.beginTask(null, Policy.totalWork);
		try {
			openConnection();
			job.run(Policy.subMonitorFor(monitor, Policy.opWork, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
		} catch (OperationCanceledException e) {
			getWorkManager().operationCanceled();
			throw e;
		} finally {
			closeConnection();
		}
	} finally {
		monitor.done();
	}
}

NOTES:

Jean-Michel (8/24/01 1:54:48 PM)
	In our current implementation a "Compare with Version" on a project with a project in another repo will cause
	multiple round-trips to retrieve the file contents to be compared. This will crash inetd running CVS pservers.
	There might be other operations in the VCM UI which call VCM fetch operations recursively or in a loop.
Comment 1 DJ Houghton CLA 2001-10-23 23:48:07 EDT
PRODUCT VERSION:
R0.9

Comment 2 Kevin McGuire CLA 2002-03-20 17:34:42 EST
fixed now that we no longer have VCM API to go through :)
Comment 3 Jean-Michel Lemieux CLA 2002-03-21 09:42:24 EST
Re-opening, we still have the multiple round trip happening in compare.

For example, the compare client gets the remote tree then in a loop calls 
getContents() on each remote handle. This will cause multiple round trips to 
the server. It would be better to batch these in one command.
Comment 4 Jean-Michel Lemieux CLA 2002-04-03 09:17:37 EST
This would require some more major refactoring of the command infrastructure 
and I'm not comfortable doing this for M5. I would even say that this is a 
feature request.
Comment 5 Jean-Michel Lemieux CLA 2002-04-10 15:26:15 EDT
*** Bug 13422 has been marked as a duplicate of this bug. ***
Comment 6 Kevin McGuire CLA 2002-04-17 16:59:23 EDT
Lets look at this as part of round we are doing on # of connection creation.
Comment 7 Jean-Michel Lemieux CLA 2002-04-19 11:24:37 EDT
Michael is working on this enhancement.
Comment 8 Michael Valenta CLA 2002-04-23 11:32:21 EDT
We now use a conection per tree when merging and comparing.