You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/scheduler-reference.adoc
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -442,6 +442,57 @@ class MyService {
442
442
443
443
NOTE: A CDI event is fired synchronously and asynchronously when the scheduler or a scheduled job is paused/resumed. The payload is `io.quarkus.scheduler.SchedulerPaused`, `io.quarkus.scheduler.SchedulerResumed`, `io.quarkus.scheduler.ScheduledJobPaused` and `io.quarkus.scheduler.ScheduledJobResumed` respectively.
444
444
445
+
[[scheduling_long_running_tasks]]
446
+
== Scheduling Long-Running Tasks
447
+
448
+
Executing a long-running task might yield a warning message similar to the following:
449
+
450
+
[source,java]
451
+
----
452
+
WARN [io.ver.cor.imp.BlockedThreadChecker] (vertx-blocked-thread-checker) Thread Thread[vert.x-worker-thread-1,5,main] has been blocked for 81879 ms, time limit is 60000 ms: io.vertx.core.VertxException: Thread blocked
453
+
----
454
+
455
+
This is happening because the default worker thread pool is coming from Vert.x which guards against threads being blocked for far too long.
456
+
457
+
NOTE: The amount of time for which a Vert.x worker thread can be blocked is also https://quarkus.io/guides/all-config#quarkus-vertx_quarkus-vertx-max-worker-execute-time[configurable].
458
+
459
+
Therefore, a proper way to execute long tasks is to offload them from the scheduled method to a custom executor service.
460
+
Here's an example of such setup for a long-running task that we do not expect to execute often:
0 commit comments