moqui / moqui-framework

Use Moqui Framework to build enterprise applications based on Java. It includes tools for databases (relational, graph, document), local and web services, web and other UI with screens and forms, security, file/resource access, scripts, templates, l10n, caching, logging, search, rules, workflow, multi-instance, and integration.
http://www.moqui.org
Other
279 stars 199 forks source link

job lock #591

Open daiagou opened 1 year ago

daiagou commented 1 year ago

There are two issues here that can cause the job to lock,

  1. Because the lock is first applied and then the service is executed, it will not be unlocked until the service is completed. If an abnormal exit occurs midway through the execution (such as a server restart), the lock will remain locked, with a default timeout of one day. Our current approach to this issue is to modify the 'EXPIRE_LOCK_TIME' value of the job table to ensure that the job is not locked for too long.
  2. Hazelcast will cause job lock, as the default delay for job startup is 120s. However, if Hazelcast is integrated, it may be executed through distributed services, bypassing the 120s delay, and there is a possibility that the instance may not be initialized successfully and the job has already been executed, causing anomalies. This exception has not been unlocked for processing.

The current temporary solution is to set the 'local_only' attribute of each job to true.