Giter VIP home page Giter VIP logo

pyxxl's Introduction

Hi there 👋

  • 👋 I’m a DevOps developer in company, with Python🐍,Vue...
  • ☝ I'm current learning and using Rust.

🧑‍💼

pyxxl's People

Contributors

fcfangcc avatar pre-commit-ci[bot] avatar sydowma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyxxl's Issues

并发情况,任务参数重复/漏任务

xxl admin同时进行三次调度,即任务执行在同一秒,xxl日志显示1毫秒完成三次任务发送,三次任务参数不同;
python执行器获取到的三次参数,有一次重复,即同一参数的任务获取了两次,另一任务参数未获取到;
还不清楚什么原因;

每次执行完任务之后,都会报空指针异常

job方法:

@app.register(name="processData")
async def test_task():
    # 模拟异步操作
    await asyncio.sleep(1)
    return "成功..."

调用结果截图:

image

报错日志详情

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pyxxl/executor.py", line 228, in _run
    await self.xxl_client.callback(data.logId, start_time, code=200, msg=result)
  File "/usr/local/lib/python3.9/site-packages/pyxxl/xxl_client.py", line 81, in callback
    await self._post("callback", payload)
  File "/usr/local/lib/python3.9/site-packages/pyxxl/xxl_client.py", line 93, in _post
    raise XXLRegisterError(r.msg or "")
pyxxl.error.XXLRegisterError: java.lang.NullPointerException

感谢作者开发该项目,希望能一起帮忙解决

AttributeError: Can't pickle local object 'PyxxlRunner.run_with_daemon.<locals>._runner'

AttributeError: Can't pickle local object 'PyxxlRunner.run_with_daemon.._runner'
搭配 FastAPI 一起使用时,按照文档上的方法操作,发现爆这个错误

python 3.9.15

试了一下 example 也同样有这个问题

  self.cfg.when_ready(self)
  File "gunicorn.conf.py", line 30, in when_ready
    runner.run_with_daemon()
  File "/Users/xxx/xxx/xxx/pyxxl/example/gunicorn_app/env/lib/python3.9/site-packages/pyxxl/main.py", line 110, in run_with_daemon
    daemon.start()
  File "/opt/homebrew/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/opt/homebrew/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/opt/homebrew/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/opt/homebrew/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/opt/homebrew/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/opt/homebrew/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/opt/homebrew/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'PyxxlRunner.run_with_daemon.<locals>._runner'

执行完任务后,就掉线了,然后后续就不会再重试链接上服务端,导致服务端调度失败

2023-11-02 13:37:08.362 [MainThread] [170428] WARNING /usr/local/lib/python3.9/site-packages/pyxxl/executor.py(_run:237) -
Traceback (most recent call last):
File "/app/main.py", line 21, in test_task
await asyncio.sleep(1)
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 652, in sleep
return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 490, in wait_for
return fut.result()
asyncio.exceptions.CancelledError

和flask集成

如何和flask进行集成?
app.run_executor()会起一个web服务器,且是阻塞的,无法和flask进行集成

xxl_admin_baseurl 不支持https

xxl_admin_baseurl为https时会有问题,[SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')]

任务没法注册到注册中心

  1. 我本地git clone了xxl_job:2.3.0
  2. 启动了xxl-job-admin(127.0.0.1:8080)、xxl-job-executor-sample-springboot(127.0.0.1:9999)
  3. 然后运行pyxxl项目的app.py,但是在xxl-job-admin(127.0.0.1:8080)没有发现任务被注册上去,可以帮忙解决一下吗,是有什么配置错误了吗

image
image
image

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.