You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zclllyybb (via GitHub)" <gi...@apache.org> on 2024/10/21 12:05:22 UTC
[PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
zclllyybb opened a new pull request, #42210:
URL: https://github.com/apache/doris/pull/42210
## Proposed changes
Issue Number: close #xxx
use a proper sleep interval to balance both:
a. no interrupt so no bdbje writing break which leads to crash
b. the daemon threads don't need much time to know its interval change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "BiteTheDDDDt (via GitHub)" <gi...@apache.org>.
BiteTheDDDDt commented on code in PR #42210:
URL: https://github.com/apache/doris/pull/42210#discussion_r1810365509
##########
fe/fe-core/src/main/java/org/apache/doris/clone/DynamicPartitionScheduler.java:
##########
@@ -806,6 +807,48 @@ private void initDynamicPartitionTable() {
initialize = true;
}
+ // specialized schedule logic. split sleep to many small pieces. so if interval changed, it won't take too much
+ // time to aware.
+ @Override
+ public void run() {
+ if (metaContext != null) {
+ metaContext.setThreadLocalInfo();
+ }
+
+ while (!isStop.get()) {
+ try {
+ runOneCycle();
+ } catch (Throwable e) {
+ LOG.error("daemon thread got exception. name: {}", getName(), e);
+ }
+
+ try {
+ long oldInterval = intervalMs;
+ long remainingInterval = oldInterval;
+ while (remainingInterval > 5000L) {
Review Comment:
avoid magic number 5000
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42210:
URL: https://github.com/apache/doris/pull/42210#issuecomment-2426482775
Thank you for your contribution to Apache Doris.
Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)
Since 2024-03-18, the Document has been moved to [doris-website](https://github.com/apache/doris-website).
See [Doris Document](https://cwiki.apache.org/confluence/display/DORIS/Doris+Document).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42210:
URL: https://github.com/apache/doris/pull/42210#issuecomment-2430742340
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 merged PR #42210:
URL: https://github.com/apache/doris/pull/42210
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42210:
URL: https://github.com/apache/doris/pull/42210#issuecomment-2428501952
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on PR #42210:
URL: https://github.com/apache/doris/pull/42210#issuecomment-2426482826
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "HappenLee (via GitHub)" <gi...@apache.org>.
HappenLee commented on code in PR #42210:
URL: https://github.com/apache/doris/pull/42210#discussion_r1809763318
##########
fe/fe-core/src/main/java/org/apache/doris/common/util/Daemon.java:
##########
@@ -119,9 +119,23 @@ public void run() {
}
try {
- Thread.sleep(intervalMs);
+ long oldInterval = intervalMs;
+ long remainingInterval = oldInterval;
+ while (remainingInterval > 5000L) {
+ // if it changed. let it know at most 10 seconds. and 5 second per wakeup is acceptable.
+ if (intervalMs != oldInterval) { // changed
+ break;
+ }
+
+ Thread.sleep(5000L);
+ remainingInterval -= 5000L;
+ }
+ if (remainingInterval <= 5000L) {
+ Thread.sleep(remainingInterval);
+ }
} catch (InterruptedException e) {
- LOG.info("InterruptedException: ", e);
+ // the daemon thread should NOT be interrupted. or meet bdbje writing, it will be disaster.
+ LOG.warn("InterruptedException: ", e);
Review Comment:
disaster only log warning not fatal?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42210:
URL: https://github.com/apache/doris/pull/42210#issuecomment-2428733420
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on PR #42210:
URL: https://github.com/apache/doris/pull/42210#issuecomment-2428805905
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Fix](fe) Avoid interrupt daemon thread and use proper polling interval [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on PR #42210:
URL: https://github.com/apache/doris/pull/42210#issuecomment-2428145257
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org