Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions source/bulkdata/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,25 @@ static void freeReportProfileConfig(void *data)
}
}

static void* deleteProfileAsync(void *data)
{
char *profileName = (char *)data;

if(profileName == NULL)
{
T2Error("profileName is NULL in deleteProfileAsync\n");
return NULL;
}

if(T2ERROR_SUCCESS != deleteProfile(profileName))
{
T2Error("Failed to delete profile asynchronously: %s\n", profileName);
}

free(profileName);
return NULL;
}

void freeProfile(void *data)
{
T2Debug("%s ++in \n", __FUNCTION__);
Expand Down Expand Up @@ -822,15 +841,27 @@ static void* CollectAndReport(void* data)
}
T2Error("ERROR: no method provider; profile will be deleted: %s %s\n", profile->name,
profile->t2RBUSDest->rbusMethodName);
if(T2ERROR_SUCCESS != deleteProfile(profile->name))
char *profileNameCopy = strdup(profile->name);
pthread_t deleteThread;
if(profileNameCopy == NULL)
{
T2Error("Failed to allocate profile name for async delete: %s\n", profile->name);
T2Info("%s --out\n", __FUNCTION__);
goto reportThreadEnd;
}
if(pthread_create(&deleteThread, NULL, deleteProfileAsync, profileNameCopy) != 0)
Comment thread
AravindanNC marked this conversation as resolved.
{
T2Error("Failed to delete profile after RBUS_METHOD failures: %s\n", profile->name);
T2Error("Failed to spawn async delete thread after RBUS_METHOD failures: %s\n", profile->name);
free(profileNameCopy);
T2Info("%s --out\n", __FUNCTION__);
Comment thread
AravindanNC marked this conversation as resolved.
//return NULL;
goto reportThreadEnd;
}
if(pthread_detach(deleteThread) != 0)
{
T2Warning("Failed to detach async delete thread for profile: %s\n", profile->name);
}
T2Info("Queued async delete for profile after RBUS_METHOD failures: %s\n", profile->name);
T2Info("%s --out\n", __FUNCTION__);
//return NULL;
goto reportThreadEnd;
}
}
Expand Down
Loading