Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 26e56a3

Browse files
author
Vladimir Ershov
committed
Merge commit '3e1c82d97d03ef698a9fc500c6da38b7185206d2' into PGPROEE10_scheduler
2 parents 1052fb4 + 3e1c82d commit 26e56a3

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

contrib/pgpro_scheduler/pgpro_scheduler--2.2.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,12 @@ CREATE FUNCTION version()
321321
CREATE FUNCTION get_self_id()
322322
RETURNS bigint
323323
AS 'MODULE_PATHNAME', 'get_self_id'
324-
LANGUAGE C IMMUTABLE;
324+
LANGUAGE C VOLATILE;
325325

326326
CREATE FUNCTION resubmit(run_after interval default NULL)
327327
RETURNS bigint
328328
AS 'MODULE_PATHNAME', 'resubmit'
329-
LANGUAGE C IMMUTABLE;
329+
LANGUAGE C VOLATILE;
330330

331331
CREATE FUNCTION cancel_job(job_id bigint) RETURNS boolean AS
332332
$BODY$

contrib/pgpro_scheduler/src/scheduler_executor.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,6 @@ int process_one_job(schd_executor_share_state_t *shared, schd_executor_status_t
796796

797797
scheduler_atjob_id_OID = get_atttype(subm_rel_oid, 1);
798798

799-
800-
801799
job = get_at_job_for_process(mem, shared->nodename, &error);
802800
if(!job)
803801
{
@@ -807,10 +805,16 @@ int process_one_job(schd_executor_share_state_t *shared, schd_executor_status_t
807805
elog(LOG, "AT EXECUTOR ERROR: get job: %s", error);
808806
pfree(error);
809807
ABORT_SPI_SNAP();
808+
MemoryContextSwitchTo(old);
809+
MemoryContextDelete(mem);
810+
810811
return -1;
811812
}
812813
STOP_SPI_SNAP();
813814
shared->status = SchdExecutorIdling;
815+
MemoryContextSwitchTo(old);
816+
MemoryContextDelete(mem);
817+
814818
return 0;
815819
}
816820
if(scheduler_atjob_id_OID != INT8OID)
@@ -843,6 +847,8 @@ int process_one_job(schd_executor_share_state_t *shared, schd_executor_status_t
843847
{
844848
elog(LOG, "AT-EXECUTOR ERROR: move after auth: %s", set_error);
845849
ABORT_SPI_SNAP();
850+
MemoryContextSwitchTo(old);
851+
MemoryContextDelete(mem);
846852
return -1;
847853
}
848854
STOP_SPI_SNAP();

contrib/pgpro_scheduler/src/scheduler_job.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
641641
values[4] = TimestampTzGetDatum(timestamp_add_seconds(0, resubmit));
642642
values[11] = Int64GetDatum(job->attempt + 1);
643643
n = 17;
644-
elog(LOG, "resubmit job %ld, %d", resubmit, job->attempt + 1);
645644
}
646645
else
647646
{

0 commit comments

Comments
 (0)