Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gvfs-helper: create tool to fetch objects using the GVFS Protocol #191

Conversation

jeffhostetler
Copy link

@jeffhostetler jeffhostetler commented Sep 5, 2019

Create helper tool to use the GVFS Protocol REST API to
fetch objects and configuration data from a GVFS cache-server
or a primary Git server.

This is V2. It replaces my earlier version from
#190

This version refactors pretty much everything and eliminates most
of the code duplication between the various GET and POST forms.
It also clarifies and centralizes the error handling.

This version eliminates the modifications to http.[ch] and credential.[ch]
that I needed in V1. Everything is now self-contained in gvfs-helper.c.

Usage is the same as before (and described in the TODO comment
at the top of the source file).

Copy link

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

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

This is really coming together!

My only big comment is that we'll want to spin out many of the TODOs as issues so we remember to follow up later.

* later rename it to a proper .pack and run "git index-pack" on
* it to create the corresponding .idx file.
*
* TODO I would rather to just stream the packfile directly into

Choose a reason for hiding this comment

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

This is an important TODO to handle in a follow-up. Let's create an issue for it.

(long)tv.tv_usec);
}

// TODO should this be in the "<ODB>/pack/tempPacks/"

Choose a reason for hiding this comment

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

Yes, the tempPacks dir would more closely match the behavior of scalar prefetch --folders and we would avoid issues with hardware failure before a full flush during indexing.

// TODO consider capturing stdout from index-pack because
// TODO it will contain the SHA of the packfile and we can
// TODO (should?) add it to the .pack and .idx pathnames
// TODO when we install them.

Choose a reason for hiding this comment

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

It would be best to add it to the names, if possible.

Choose a reason for hiding this comment

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

Keep in mind that it's the last 20 bytes of the .pack, but the last 21-40 bytes of the .idx file.

Copy link
Member

@wilbaker wilbaker left a comment

Choose a reason for hiding this comment

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

Posting comments/questions that I have so far. Still looking through the rest of gvfs-helper.c

new_branch_info->commit,
opts->show_progress);
exit(1);
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Will this code be removed before merging (I'm assuming it's for local testing)?

Copy link
Author

Choose a reason for hiding this comment

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

this is still a WIP. not sure if i need it or not going forward.

struct object *obj,
const char *pathname,
const char *filename,
void *filter_data_)
Copy link
Member

Choose a reason for hiding this comment

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

Coding in Git question, is there any special significance to this parameter name ending in _?

Copy link
Author

Choose a reason for hiding this comment

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

There's no official significance to it.
I just did it to try to keep track of the void* callback context handle
and give it a little more meaning than "data" or "cb" or "ctx" as is
usual.

The callback API wants a void , but the first thing I want to do inside
the function is to cast it to a specific type. So there's always a dance
in these types of functions to assign void
to a typed alias. This was
my attempt to make the CB API contract a little more meaningful.

GH__ERROR_CODE__USAGE = -1, /* will be mapped to usage() */
GH__ERROR_CODE__OK = 0,
GH__ERROR_CODE__ERROR = 1, /* unspecified */
// GH__ERROR_CODE__CACHE_SERVER_NOT_FOUND = 2,
Copy link
Member

Choose a reason for hiding this comment

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

Why is this error code commented out?

Copy link
Author

Choose a reason for hiding this comment

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

I overhauled the error return codes and eliminated the need for this one. I intend to delete it.

gvfs-helper.c Outdated
else if (!strcmp(k, "core.gvfs"))
gh__cmd_opts.is_core_vfs = 1;

else if (!strcmp(k, "core.scalar"))
Copy link
Member

Choose a reason for hiding this comment

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

Currently Scalar is setting core.gvfs (with the specific flags it wants) and not core.scalar is that going to cause any issues?

Copy link
Author

Choose a reason for hiding this comment

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

No. I was anticipating that we'd get a core.scalar flag as part of the global rename. If that's not the case, I can get rid of this.

@jeffhostetler jeffhostetler force-pushed the sc223-gvfs-helper branch 2 times, most recently from 91a411b to a72e8f8 Compare September 23, 2019 20:02
@jeffhostetler
Copy link
Author

Rebased forward to tip of feature branch. This version currently omits the "--filter=sparse:cone" code because of a massive conflict with upstream. (And I'm not convinced I still need it.)

v2_path++;

prepare_alt_odb(the_repository);
for (odb = the_repository->objects->odb; odb; odb = odb->next)

Choose a reason for hiding this comment

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

@jeffhostetler I think this API could be done significantly differently and make our lives less error prone. The client should pick an ODB based on the config value (and do a platform path conversion to get into some “canonical” form) and then start the helper with that path in mind. The helper could just return a loose object oid or a pack name. We wouldn’t need this loop on every response. We could navigate directly to the odb pointer we have already.

That would at least help the windows bugs I’m having. The Mac test failure needs some more investigation.

Copy link
Author

Choose a reason for hiding this comment

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

I like that. Let me take a look at that. That will simplify things considerably.

@derrickstolee
Copy link

@jeffhostetler with your latest changes (3446dd0) I ran the tests with this one failure in the parallel case:

System.AggregateException : One or more errors occurred. (  fatal: missing blob object '9d40b0f1651f323765cb38b3e7afe42fab3f0aef'
  Expected: 0
  But was:  128

It is being output in this spot of builtin/rev-list.c:

static inline void finish_object__ma(struct object *obj)
{
	/*
	 * Whether or not we try to dynamically fetch missing objects
	 * from the server, we currently DO NOT have the object.  We
	 * can either print, allow (ignore), or conditionally allow
	 * (ignore) them.
	 */
	switch (arg_missing_action) {
	case MA_ERROR:
		die("missing %s object '%s'",
		    type_name(obj->type), oid_to_hex(&obj->oid));
		return;

	case MA_ALLOW_ANY:
		return;

	case MA_PRINT:
		oidset_insert(&missing_objects, &obj->oid);
		return;

	case MA_ALLOW_PROMISOR:
		if (is_promisor_object(&obj->oid))
			return;
		die("unexpected missing %s object '%s'",
		    type_name(obj->type), oid_to_hex(&obj->oid));
		return;

	default:
		BUG("unhandled missing_action");
		return;
	}
}

@derrickstolee
Copy link

I added the following line to gvfs-helper-client.c where you already had a trace2_printf():

	trace2_data_string("gvfs-helper", the_repository, "ghc__get_immediate", oid_to_hex(oid));

This allowed me to run the functional tests with GIT_TRACE2_EVENT pointing to a log file. The relevant events are here:


{"event":"cmd_name","sid":"20191002T184920.003088Z-H9764d87b-P00004723","thread":"main","time":"2019-10-02T18:49:20.005234Z","file":"git.c","line":508,"name":"rev-list","hierarchy":"rev-list"}
{"event":"cmd_name","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.005250Z","file":"git.c","line":508,"name":"rev-list","hierarchy":"rev-list"}
{"event":"data","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.011331Z","file":"gvfs-helper-client.c","line":402,"repo":1,"t_abs":0.008517,"t_rel":0.008517,"nesting":1,"category":"gvfs-helper","key":"ghc__get_immediate","value":"9d40b0f1651f323765cb38b3e7afe42fab3f0aef"}
{"event":"region_enter","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.011360Z","file":"gvfs-helper-client.c","line":280,"repo":1,"nesting":1,"category":"gh-client","label":"get"}
{"event":"data","sid":"20191002T184920.003088Z-H9764d87b-P00004723","thread":"main","time":"2019-10-02T18:49:20.011369Z","file":"gvfs-helper-client.c","line":402,"repo":1,"t_abs":0.008553,"t_rel":0.008553,"nesting":1,"category":"gvfs-helper","key":"ghc__get_immediate","value":"9d40b0f1651f323765cb38b3e7afe42fab3f0aef"}
{"event":"region_enter","sid":"20191002T184920.003088Z-H9764d87b-P00004723","thread":"main","time":"2019-10-02T18:49:20.011395Z","file":"gvfs-helper-client.c","line":280,"repo":1,"nesting":1,"category":"gh-client","label":"get"}
{"event":"child_start","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.011410Z","file":"run-command.c","line":736,"child_id":0,"child_class":"subprocess","use_shell":true,"argv":["git","gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"child_start","sid":"20191002T184920.003088Z-H9764d87b-P00004723","thread":"main","time":"2019-10-02T18:49:20.011440Z","file":"run-command.c","line":736,"child_id":0,"child_class":"subprocess","use_shell":true,"argv":["git","gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"version","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724","thread":"main","time":"2019-10-02T18:49:20.019722Z","file":"common-main.c","line":42,"evt":"1","exe":"2.23.0.vfs.1.1.67.g7c2ff67280.dirty"}
{"event":"start","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724","thread":"main","time":"2019-10-02T18:49:20.019762Z","file":"common-main.c","line":43,"t_abs":0.001057,"argv":["/usr/local/libexec/git-core/git","gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"version","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725","thread":"main","time":"2019-10-02T18:49:20.019943Z","file":"common-main.c","line":42,"evt":"1","exe":"2.23.0.vfs.1.1.67.g7c2ff67280.dirty"}
{"event":"start","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725","thread":"main","time":"2019-10-02T18:49:20.019981Z","file":"common-main.c","line":43,"t_abs":0.001033,"argv":["/usr/local/libexec/git-core/git","gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"cmd_name","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724","thread":"main","time":"2019-10-02T18:49:20.020054Z","file":"git.c","line":767,"name":"_run_dashed_","hierarchy":"rev-list/_run_dashed_"}
{"event":"child_start","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724","thread":"main","time":"2019-10-02T18:49:20.020081Z","file":"run-command.c","line":736,"child_id":0,"child_class":"dashed","use_shell":false,"argv":["git-gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"cmd_name","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725","thread":"main","time":"2019-10-02T18:49:20.020241Z","file":"git.c","line":767,"name":"_run_dashed_","hierarchy":"rev-list/_run_dashed_"}
{"event":"child_start","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725","thread":"main","time":"2019-10-02T18:49:20.020270Z","file":"run-command.c","line":736,"child_id":0,"child_class":"dashed","use_shell":false,"argv":["git-gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"version","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.034135Z","file":"common-main.c","line":42,"evt":"1","exe":"2.23.0.vfs.1.1.67.g7c2ff67280.dirty"}
{"event":"version","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.034160Z","file":"common-main.c","line":42,"evt":"1","exe":"2.23.0.vfs.1.1.67.g7c2ff67280.dirty"}
{"event":"start","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.034177Z","file":"common-main.c","line":43,"t_abs":0.000976,"argv":["/usr/local/libexec/git-core/git-gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"start","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.034199Z","file":"common-main.c","line":43,"t_abs":0.001049,"argv":["/usr/local/libexec/git-core/git-gvfs-helper","--fallback","--cache-server=trust","--shared-cache=/Users/stolee/Scalar.FT/c295175375894875925597b6e8d5fa37/.customScalarCache/79f28452cdde4b59a77e633508768e1c","server"]}
{"event":"cmd_name","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.034220Z","file":"gvfs-helper.c","line":2243,"name":"gvfs-helper","hierarchy":"rev-list/_run_dashed_/gvfs-helper"}
{"event":"cmd_name","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.034242Z","file":"gvfs-helper.c","line":2243,"name":"gvfs-helper","hierarchy":"rev-list/_run_dashed_/gvfs-helper"}
{"event":"def_repo","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.034388Z","file":"repository.c","line":130,"repo":1,"worktree":"/Users/stolee/Scalar.FT/test/b07cf69385364400a7fd/src"}
{"event":"def_repo","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.034406Z","file":"repository.c","line":130,"repo":1,"worktree":"/Users/stolee/Scalar.FT/test/89b74c5133454b7ebb97/src"}
{"event":"cmd_mode","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.034574Z","file":"gvfs-helper.c","line":2151,"name":"server"}
{"event":"cmd_mode","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.034590Z","file":"gvfs-helper.c","line":2151,"name":"server"}
{"event":"data","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.034663Z","file":"gvfs-helper.c","line":681,"t_abs":0.001475,"t_rel":0.001475,"nesting":1,"category":"gvfs-helper","key":"remote/url","value":"https://gvfs.visualstudio.com/ci/_git/ForTests"}
{"event":"data","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.034678Z","file":"gvfs-helper.c","line":681,"t_abs":0.001535,"t_rel":0.001535,"nesting":1,"category":"gvfs-helper","key":"remote/url","value":"https://gvfs.visualstudio.com/ci/_git/ForTests"}
{"event":"data","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.035705Z","file":"gvfs-helper.c","line":719,"t_abs":0.002558,"t_rel":0.002558,"nesting":1,"category":"gvfs-helper","key":"cache/url","value":"same"}
{"event":"data","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.035747Z","file":"gvfs-helper.c","line":719,"t_abs":0.002512,"t_rel":0.002512,"nesting":1,"category":"gvfs-helper","key":"cache/url","value":"same"}
{"event":"region_enter","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.035818Z","file":"gvfs-helper.c","line":1984,"nesting":1,"category":"gvfs-helper","label":"server/get"}
{"event":"data","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.035835Z","file":"gvfs-helper.c","line":1985,"t_abs":0.002698,"t_rel":0.000021,"nesting":2,"category":"gvfs-helper","key":"server/get/nr_objects","value":"1"}
{"event":"region_enter","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.035854Z","file":"gvfs-helper.c","line":1984,"nesting":1,"category":"gvfs-helper","label":"server/get"}
{"event":"data","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.035878Z","file":"gvfs-helper.c","line":1985,"t_abs":0.002691,"t_rel":0.000035,"nesting":2,"category":"gvfs-helper","key":"server/get/nr_objects","value":"1"}
{"event":"region_leave","sid":"20191002T184920.003083Z-H9764d87b-P00004722/20191002T184920.018944Z-H9764d87b-P00004724/20191002T184920.033411Z-H9764d87b-P00004726","thread":"main","time":"2019-10-02T18:49:20.036156Z","file":"gvfs-helper.c","line":1987,"t_rel":0.000304,"nesting":1,"category":"gvfs-helper","label":"server/get"}
{"event":"region_enter","sid":"20191002T184920.003088Z-H9764d87b-P00004723/20191002T184920.019180Z-H9764d87b-P00004725/20191002T184920.033367Z-H9764d87b-P00004727","thread":"main","time":"2019-10-02T18:49:20.036178Z","file":"gvfs-helper.c","line":565,"nesting":2,"category":"gvfs-helper","label":"GET/objects"}
{"event":"data","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.036209Z","file":"gvfs-helper-client.c","line":347,"repo":1,"t_abs":0.033392,"t_rel":0.024841,"nesting":2,"category":"gh-client","key":"get/count","value":"1"}
{"event":"data","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.036230Z","file":"gvfs-helper-client.c","line":352,"repo":1,"t_abs":0.033422,"t_rel":0.024871,"nesting":2,"category":"gh-client","key":"get/created","value":"nothing"}
{"event":"region_leave","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.036247Z","file":"gvfs-helper-client.c","line":353,"repo":1,"t_rel":0.024889,"nesting":1,"category":"gh-client","label":"get"}
{"event":"error","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.036371Z","file":"usage.c","line":52,"msg":"missing blob object '9d40b0f1651f323765cb38b3e7afe42fab3f0aef'","fmt":"missing %s object '%s'"}
{"event":"exit","sid":"20191002T184920.003083Z-H9764d87b-P00004722","thread":"main","time":"2019-10-02T18:49:20.036399Z","file":"usage.c","line":56,"t_abs":0.033591,"code":128}

Specifically, the sid ending in 4722 output the request for the blob first, but then was the one to fail. Maybe the blob is being written by the second process as we try to read it in the first process?

@derrickstolee
Copy link

@jeffhostetler I figured out the problem: the two processes are writing to the same temp file at the same time. One "wins" its rename operation and the other loses. The fix would be one of the following:

  1. Use a random name, not "oid.temp".
  2. Use a lockfile instead of a temp file. If a lock exists, then wait and retry some amount of time.
  3. ???

Copy link

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

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

We have functional tests passing. Let's get this in!

Teach subprocess_start() to use a copy of the passed `cmd` string
rather than borrowing the buffer from the caller.

Some callers of subprocess_start() pass the value returned from
find_hook() which points to a static buffer and therefore is only
good until the next call to find_hook().  This could cause problems
for the long-running background processes managed by sub-process.c
where later calls to subprocess_find_entry() to get an existing
process will fail.  This could cause more than 1 long-running
process to be created.

TODO Need to confirm, but if only read_object_hook() uses
TODO subprocess_start() in this manner, we could drop this
TODO commit when we drop support for read_object_hook().

Signed-off-by: Jeff Hostetler <[email protected]>
Add function to start a subprocess with an argv.

Signed-off-by: Jeff Hostetler <[email protected]>
vdye pushed a commit that referenced this pull request Feb 27, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Apr 23, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Apr 23, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Apr 23, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Apr 24, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Apr 29, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request May 14, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request May 14, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jun 3, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jul 17, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jul 17, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jul 17, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jul 18, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
mjcheetham pushed a commit that referenced this pull request Jul 23, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jul 25, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
mjcheetham pushed a commit that referenced this pull request Jul 29, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Sep 18, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Sep 24, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Oct 8, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
mjcheetham pushed a commit that referenced this pull request Dec 3, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Dec 17, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Dec 18, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Dec 18, 2024
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jan 1, 2025
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jan 1, 2025
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jan 1, 2025
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jan 1, 2025
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Jan 1, 2025
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Feb 10, 2025
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit that referenced this pull request Feb 27, 2025
Includes commits from these pull requests:

	#191
	#205
	#206
	#207
	#208
	#215
	#220
	#221

Signed-off-by: Derrick Stolee <[email protected]>
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