Hi Jacky,
Both import and export tasks from the clipboard will use the job scheduler. As I understand it, Gearman should be able to handle multiple atom workers running jobs in parallel. If an import job is already running and no other Gearman workers are available, then theoretically the new task will be queued, and won't begun running until another atom-worker is available.
Technically this should be fine, but in reality, and especially with larger task (e.g. large imports, etc), it is possible for the memory available to the job scheduler to be used up, which can cause the atom-worker to stall. When that happens, the job will show in the user interface as in progress, indefinitely.
In that case, since we don't currently have a task that can end one specific job, the only option is to clear all jobs with the following command-line task:
The result of this would be that not only the stalled job is cleared, but all your other queued jobs as well - meaning you'd have to go and restart them by manually re-adding the records to the clipboard, etc.
The reason for limiting other activities is to minimize the risk of impacting shared resources in the database. In AtoM's current database schema, importing data results in expensive database operations mostly around updating hierarchical data. This causes concurrent access to the database to be suboptimal, which in turn has the potential to cause issues.
Essentially jobs are handled separately, but because they share the same database and the same resources (such as available memory), doing too much at once can cause concurrency issues, leading to other errors and problems in the database.
For this reason, I might recommend not starting another import or export job while a large UI import is already running.
It is possible to implement Gearman in different ways, and change some of its defaults - I believe that you can make more workers available, and you should be able to assign more system resources (such as memory) - you'd likely have to dig in the Gearman documentation. You could also change your PHP execution limits. See the following pages:
In terms of queueing there are likely improvements we could make with community support, such as adding support for persistent queues. See:
To ensure that all operations in AtoM are atomic and avoid potential conflicts would require a deeper analysis of AtoM's current implementation, and some refactoring.
Finally, note that another AtoM community user has shared a potential solution to prevent the atom-worker from going idle after too long a period of inactivity - see the following thread:
Please note that Artefactual has not tested this proposed solution, and as such, cannot officially recommend this - proceed at your own risk if you choose to try this, and let us know how it goes!
Regards,