Giter Club home page Giter Club logo

choerodon-asgard's People

Contributors

devil-scp avatar thefuckingcode avatar timebye avatar wang-ha0 avatar zmfcn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

choerodon-asgard's Issues

任务调度模块改进建议

版本

  • Choerodon版本: 0.16.0
  • asgard-service-0.16.0

问题描述

我们有个环境的asgard-service正常运行了一段时间,并且可以调度任务,但由于开发配置的cron表达式不正确(在秒级使用了*号),导致任务频繁执行,查看asgard_quartz_task_instance已存在4万+记录。今天触发了OOM,之后任务调度相关功能无法正常使用,每次重新启动asgard-service后大约有3分钟正常,前端的任务调度可以正常显示,过了一会儿会每隔15秒打印一次下面的WARN:

WARN 8 --- [pool-7-thread-1] i.c.a.common.AbstractAsgardConsumer : error.asgard.scheduleRunning, msg: Read timed out executing POST http://asgard-service/v1/schedules/tasks/instances/poll

进pod容器使用:127.0.0.1:18080/v1/schedules/tasks/instances/poll
调试,查看端口有监听,但curl无任何响应,长时间阻塞

影响范围

  • 首先任务调度相关所有页面无法正常显示
  • 基本凡是涉及到异步任务的功能都不能正常使用,如创建应用

问题排查

后来实在找不到有用的信息,打开DEBUG,发现有大量的查询在反复执行:

DEBUG 8 --- [ XNIO-3 task-2] i.c.a.i.m.Q.pollBathByMethod : ==> Preparing: SELECT aqti.id, aqti.execute_method AS method, aqti.execute_params, aqti.instance_lock, aqti.object_version_number, aqt.execute_strategy, aqt.user_details AS user_details_json, aqti.task_id FROM asgard_quartz_task_instance aqti INNER JOIN asgard_quartz_task aqt on aqt.id = aqti.task_id WHERE aqti.status = 'RUNNING' AND aqti.execute_method = ?

在数据库中查询此语句,响应时间过长,基本定位为任务过多阻塞了,删除了所有RUNNING的任务恢复正常,但上面那个警告仍然存在,发现其实这个WARN信息没什么用,影响了之前排查的方向~Orz

建议

由于此问题影响面比较大,为了不影响平台正常功能,建议:

  • 增加任务并发控制,超过100个RUNNING可消息告警
  • 在cron表达式校验的时候如果秒数为*号,给一个明确的警告或二次确认吧,QZ的cron和Unix的cron不一样,防止开发误配置

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.