- Issue created by @tgoeg
- 🇸🇮Slovenia bcizej
Probably the same issue as 🐛 Add timeout to waitForTask() Active . All index operations apart from searching are async in nature, ie. when requesting indexing of documents meilisearch immediately returns the response with task id that can be used to check on status of the operation. By default meilisearch-php library spends 5 seconds querying the status of the task and if the task has not completed by then it throws a timeout exception but it is possible that the task did not finish yet and is this in the process of indexing.
In your case that seems to be the issue, specially since you said that the indexing completes successfully (on meilisearch side) but the Drupal Indexing UI shows an error.
In the linked issue we increased this to 15s as we started noticing the same failures in tests (with very small datasets) but it is not a complete fix as operations could potentially take longer.
The issue is that when you trigger indexation from Drupal you see a progress bar of indexing status - documents are indexed in batches and after each batch completes the progress bar moves. So we are waiting now for maximum of 5 seconds (15 seconds on the 3.x dev branch) for the indexing operation to complete the batch but as mentioned it could take longer. But we have to take into account the php max execution time here which can differ from server to server.
Bottom line is we will have to investigate and figure out a solution on how to best handle the async operations in relation to how the search api module and UI works.