Expose fork ownership errors in file debug traces
This commit is contained in:
1 parent
c259a7330b
commit
977748b16c
3 files changed
+5
-1
No files matched your search
@@ -102,6 +102,9 @@ void mf_worker_unreserve(struct mf_work* j) { if (j) { u_free(j->completion); u_
|
||||
|
||||
void mf_worker_submit_reserved(struct mf_worker* w, struct mf_work* j,
|
||||
mf_work_fn work, void* data, mf_done_fn done, void* arg) {
|
||||
if (w->creator_pid != (long)getpid()) DEBUG_ERROR(DEBUG_CATEGORY_DEBUG,
|
||||
"member_files: worker inherited after fork creator_pid=%ld current_pid=%ld; disk thread is missing",
|
||||
w->creator_pid, (long)getpid());
|
||||
j->owner = w; j->work = work; j->data = data; j->done = done; j->arg = arg;
|
||||
j->next = w->jobs; w->jobs = j; w->count++;
|
||||
DEBUG_TRACE(DEBUG_CATEGORY_DEBUG, "member_files: worker queued owner=%p task=%p current_pid=%ld creator_pid=%ld active=%u",
|
||||
|
||||
@@ -15,7 +15,7 @@ extern char** environ;
|
||||
|
||||
static int launch(const char* config, const char* pidfile, const char* log) {
|
||||
char* argv[] = { UTUN_CLI_PATH, "-c", (char*)config, "-p", (char*)pidfile, "-l", (char*)log,
|
||||
"-d", "sys=info,media=debug", NULL };
|
||||
"-d", "sys=info,debug=trace", NULL };
|
||||
pid_t launcher;
|
||||
int error = posix_spawn(&launcher, UTUN_CLI_PATH, NULL, NULL, argv, environ);
|
||||
if (error) { DEBUG_ERROR(DEBUG_CATEGORY_SYS, "daemon test: spawn failed error=%d", error); return -1; }
|
||||
|
||||
@@ -168,6 +168,7 @@ static void tick(void* arg) {
|
||||
|
||||
int main(void) {
|
||||
debug_config_init(); debug_set_level(DEBUG_LEVEL_ERROR); debug_set_category_level(DEBUG_CATEGORY_MEDIA, DEBUG_LEVEL_DEBUG);
|
||||
debug_set_category_level(DEBUG_CATEGORY_DEBUG, DEBUG_LEVEL_TRACE);
|
||||
utun_instance_set_tun_init_enabled(0);
|
||||
struct network_test t = {0}; active = &t;
|
||||
snprintf(t.dir, sizeof(t.dir), "/tmp/utun_member_files_net_XXXXXX");
|
||||
|
||||
Reference in new issue
Block a user