提交 44ff535c 编写于 作者: A Asim R P

An infinite_loop fault should break when reset.

This commit fixes fault injector such that when a infinte_loop fault is reset,
the infinite loop is broken and the fault is removed, as expected.

Reviewed by: Jimmy Yih <jyih@pivotal.io>
上级 46c74111
......@@ -414,7 +414,9 @@ FaultInjector_InjectFaultNameIfSet(
entryLocal->faultName,
FaultInjectorTypeEnumToString[entryLocal->faultInjectorType])));
for (ii=0; ii < cnt; ii++)
for (ii=0;
ii < cnt && FaultInjector_LookupHashEntry(entryLocal->faultName);
ii++)
{
pg_usleep(1000000L); // sleep for 1 sec (1 sec * 3600 = 1 hour)
CHECK_FOR_INTERRUPTS();
......@@ -1128,7 +1130,10 @@ InjectFault(char *faultName, char *type, char *ddlStatement, char *databaseName,
if (faultEntry.faultInjectorType == FaultInjectorTypeStatus)
appendStringInfo(buf, "%s", faultEntry.bufOutput);
else
{
appendStringInfo(buf, "Success:");
elog(LOG, "injected fault '%s' type '%s'", faultName, type);
}
}
else
appendStringInfo(buf, "Failure: %s", faultEntry.bufOutput);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册