sofastack / sofa-ark

SOFAArk is a light-weight,java based classloader isolation framework.
https://www.sofastack.tech/projects/sofa-boot/sofa-ark-readme/
Apache License 2.0
1.56k stars 497 forks source link

Biz module startup order problem #310

Closed quhw closed 4 years ago

quhw commented 4 years ago

Describe the bug

两个模块: 主模块:demo-app-bootstrap-1.0.0-SNAPSHOT-ark-biz.jar
业务模块:demo-biz-1.0.0-SNAPSHOT-ark-biz.jar

默认的priority,conf/ark/bootstrap.properties指定了demo-app-bootstrap是主模块。

Expected behavior

先加载demo-app-bootstrap,后加载demo-biz。

Actual behavior

先加载了demo-biz,启动失败。 telnet localhost 1234,biz -a,发现demo-biz顺序在demo-app-bootstrap之前。biz -m看,两个模块的priority都是100。

后来pom.xml加了priority,问题解决。

应该master有最高优先级。

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

sofastack-bot[bot] commented 4 years ago

Hi @quhw, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

Describe the bug Two modules: Main module: demo-app-bootstrap-1.0.0-SNAPSHOT-ark-biz.jar Business module: demo-biz-1.0.0-SNAPSHOT-ark-biz.jar Default Priority, conf/ark/bootstrap.properties specifies that demo-app-bootstrap is the main module. ### Expected behavior Load demo-app-bootstrap first, then load demo-biz. ### Actual behavior The demo-biz was loaded first and the startup failed. Telnet localhost 1234, biz -a, found that the demo-biz order is before the demo-app-bootstrap. Biz-m, the priority of both modules is 100. Later pom.xml added priority, the problem is solved. The master should have the highest priority. ### Steps to reproduce ### Minimal yet complete reproducer code (or GitHub URL to code) ### Environment - SOFAArk version: 1.0.0 - JVM version (eg java -version): - OS version (eg Uname -a): - Maven version: - IDE version:

glmapper commented 4 years ago

@quhw 所有 biz 的默认优先级都是 100,ark 在 pipeline 其中流程中,会对 biz 进行排序,然后决定 各个biz 的启动顺序,不会对 master 做特殊的处理