Exception handlers do not handle TransportExceptions

Created on 8 November 2024, about 1 month ago

Problem/Motivation

Hello,

I was testing elasticsearch_connector update to v8.0.0-alpha2, and our DTT tests completely unrelated to search are failing after the update. I was debugging the issue, and the failure is caused by search_api_entity_delete hook, which is triggered by deleting a node. This eventually triggers NoNodeAvailableException, since we are not running elasticsearch on our CI.

I would argue that exception handlers like this could also catch Elastic\Transport\Exception\TransportException as well, so if the elasticsearch is not available, the exception would be handled withing search_api or elasticsearch_connector.

In my case, the NoNodeAvailableException is finally caught in SqlContentEntity::delete and transformed into a EntityStorageException.

Steps to reproduce

Make sure elasticsearch is not available. Delete an entity that tracked by search_api.

Proposed resolution

Handle Elastic\Transport\Exception\TransportException exceptions in BackendClient.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

8.0

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024