mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-28 09:46:44 +08:00
Fix assertion failure in job_stat error handling
Since CopyErrorData asserts that the current MemoryContext is not ErrorContext we need to make sure to switch context before copying ErrorData.
This commit is contained in:
parent
8e1e6036af
commit
58b4622346
@ -238,6 +238,7 @@ calculate_next_start_on_failure(TimestampTz finish_time, int consecutive_failure
|
||||
}
|
||||
PG_CATCH();
|
||||
{
|
||||
MemoryContextSwitchTo(oldctx);
|
||||
ErrorData *errdata = CopyErrorData();
|
||||
ereport(LOG,
|
||||
(errcode(ERRCODE_INTERNAL_ERROR),
|
||||
@ -247,7 +248,7 @@ calculate_next_start_on_failure(TimestampTz finish_time, int consecutive_failure
|
||||
RollbackAndReleaseCurrentSubTransaction();
|
||||
}
|
||||
PG_END_TRY();
|
||||
MemoryContextSwitchTo(oldctx);
|
||||
Assert(CurrentMemoryContext == oldctx);
|
||||
if (!res_set)
|
||||
{
|
||||
TimestampTz nowt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user