首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Web2Py调度器使Postgress崩溃

Web2Py调度器使Postgress崩溃
EN

Stack Overflow用户
提问于 2018-10-11 19:22:14
回答 1查看 106关注 0票数 0

我将scheduler用作Linux服务。

我创建了一个文件/etc/systemd/system/web2py-Schedul.service

代码语言:javascript
复制
[Unit]
Description=Web2Py scheduler service

[Service]
ExecStart=/usr/bin/python /home/www-data/web2py/web2py.py -K myApp
Type=simple
Restart=always
[Install]
WantedBy=multi-user.target

然后安装服务调用:

代码语言:javascript
复制
sudo systemctl enable /etc/systemd/system/web2py-sched.service 

systemctl start /etc/systemd/system/web2py-sched

现在,在运行了一天之后,我发现Postgress崩溃了,或者apache服务器崩溃了。我无法追踪apache的日志。但在Postgress日志中,我发现:

代码语言:javascript
复制
2018-10-10 06:56:17 PDT [22303-1] spm@mydb LOG:  unexpected EOF on client connection with an open transaction
2018-10-10 06:56:17 PDT [18799-7] LOG:  server process (PID 22304) was terminated by signal 9: Killed
2018-10-10 06:56:17 PDT [18799-8] DETAIL:  Failed process was running: SELECT "scheduler_task"."id", "scheduler_task"."application_name", "scheduler_task"."task_name", "scheduler_task"."group_name", "scheduler_task"."status", "scheduler_task"."function_name", "scheduler_task"."uuid", "scheduler_task"."args", "scheduler_task"."vars", "scheduler_task"."enabled", "scheduler_task"."start_time", "scheduler_task"."next_run_time", "scheduler_task"."stop_time", "scheduler_task"."repeats", "scheduler_task"."retry_failed", "scheduler_task"."period", "scheduler_task"."prevent_drift", "scheduler_task"."cronline", "scheduler_task"."timeout", "scheduler_task"."sync_output", "scheduler_task"."times_run", "scheduler_task"."times_failed", "scheduler_task"."last_run_time", "scheduler_task"."assigned_worker_name" FROM "scheduler_task" WHERE (("scheduler_task"."assigned_worker_name" = 'myApp#22265') AND ("scheduler_task"."status" = 'ASSIGNED')) ORDER BY "scheduler_task"."next_run_time" LIMIT 1 OFFSET 0;
2018-10-10 06:56:17 PDT [18799-9] LOG:  terminating any other active server processes
2018-10-10 06:56:17 PDT [22256-2] WARNING:  terminating connection because of crash of another server process
2018-10-10 06:56:17 PDT [22256-3] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2018-10-10 06:56:17 PDT [22256-4] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2018-10-10 06:56:17 PDT [18799-10] LOG:  all server processes terminated; reinitializing
2018-10-10 06:56:17 PDT [22457-1] LOG:  database system was interrupted; last known up at 2018-10-10 06:55:04 PDT
2018-10-10 06:56:18 PDT [22457-2] LOG:  database system was not properly shut down; automatic recovery in progress
2018-10-10 06:56:18 PDT [22457-3] LOG:  redo starts at 0/C1C85F94
2018-10-10 06:56:18 PDT [22457-4] LOG:  invalid record length at 0/C1C88100
2018-10-10 06:56:18 PDT [22457-5] LOG:  redo done at 0/C1C880DC
2018-10-10 06:56:18 PDT [22457-6] LOG:  last completed transaction was at log time 2018-10-10 06:56:16.925482-07
2018-10-10 06:56:18 PDT [22457-7] LOG:  MultiXact member wraparound protections are now enabled
2018-10-10 06:56:18 PDT [18799-11] LOG:  database system is ready to accept connections
2018-10-10 06:56:18 PDT [22491-1] LOG:  autovacuum launcher started
2018-10-10 06:56:31 PDT [22500-1] spm@mydb LOG:  unexpected EOF on client connection with an open transaction
2018-10-10 06:56:31 PDT [22501-1] spm@mydb LOG:  unexpected EOF on client connection with an open transaction
2018-10-10 06:56:31 PDT [22594-1] spm@mydb LOG:  unexpected EOF on client connection with an open transaction
2018-10-10 06:56:31 PDT [22595-1] spm@mydb LOG:  unexpected EOF on client connection with an open transaction
2018-10-10 06:56:33 PDT [18799-12] LOG:  autovacuum launcher process (PID 22491) was terminated by signal 9: Killed
2018-10-10 06:56:33 PDT [18799-13] LOG:  terminating any other active server processes
2018-10-10 06:56:33 PDT [18799-14] LOG:  all server processes terminated; reinitializing
2018-10-10 06:56:33 PDT [22638-1] LOG:  database system was interrupted; last known up at 2018-10-10 06:56:18 PDT
2018-10-10 06:56:33 PDT [18799-15] LOG:  startup process (PID 22638) was terminated by signal 9: Killed
2018-10-10 06:56:33 PDT [18799-16] LOG:  aborting startup due to startup process failure

我已确保所有事务都已提交。但是,它是否像代码在调用提交之前的某个时刻退出。

在上述日志中:

代码语言:javascript
复制
2018-10-10 06:56:17 PDT [18799-8] DETAIL:  Failed process was running: SELECT "scheduler_task"."id", "scheduler_task"."application_name", "scheduler_task"."task_name", "scheduler_task"."group_name", "scheduler_task"."status", "scheduler_task"."function_name", "scheduler_task"."uuid", "scheduler_task"."args", "scheduler_task"."vars", "scheduler_task"."enabled", "scheduler_task"."start_time", "scheduler_task"."next_run_time", "scheduler_task"."stop_time", "scheduler_task"."repeats", "scheduler_task"."retry_failed", "scheduler_task"."period", "scheduler_task"."prevent_drift", "scheduler_task"."cronline", "scheduler_task"."timeout", "scheduler_task"."sync_output", "scheduler_task"."times_run", "scheduler_task"."times_failed", "scheduler_task"."last_run_time", "scheduler_task"."assigned_worker_name" FROM "scheduler_task" WHERE (("scheduler_task"."assigned_worker_name" = 'myApp#22265') AND ("scheduler_task"."status" = 'ASSIGNED')) ORDER BY "scheduler_task"."next_run_time" LIMIT 1 OFFSET 0;

版本

代码语言:javascript
复制
2.15.4-stable+timestamp.2017.09.02.04.02.22
(Running on Apache/2.4.18 (Ubuntu), Python 2.7.12)
EN

回答 1

Stack Overflow用户

发布于 2018-10-19 04:56:09

首先尝试将web2py更新为当前版本(2.17.2-stable+timestamp.2018.10.06.18.54.02)。在上一个版本中启动工作进程时出现问题。

在我的例子中,更新解决了调度器问题。如果这还不能解决问题,请让我知道。也许我还有更多的建议。

向克莱门斯致以最好的问候

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52758813

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档