CDMResultsAnalysisRunner hides exception leading to caching empty reports
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 151
- Forks
- 183
- Avg merge
- 14m
- Merged PRs (30d)
- 2
Description
Expected behavior
When experiencing a sql error from an achilles (Datasources) query drilldown, that drilldown should not cache any information.
Actual behavior
When an error is raised, the exception is logged, but an empty object is returned.
Steps to reproduce behavior
Difficult to reproduce because you have to craft your raw data to result in an error, but the troublesome line is found here:
public JsonNode getDrilldown(JdbcTemplate jdbcTemplate,
String domain,
Integer conceptId,
Source source) {
ObjectNode objectNode = objectMapper.createObjectNode();
...
...
...
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return objectNode;
The context is the getDrilldown() is called when we don't find data in the cache. The getDrilldown() will attempt to fetch the data from the source. For this example, the query resulted in an error, which is simply logged. The objectNode is still returned, which contains no data, and this 'no data' result is cached. There's no way to re-cache it without deleting the record from the webapi cache.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/java/org/ohdsi/webapi/report/CDMResultsAnalysisRunner.java at getDrilldown(), especially the catch block around line 287. Trace its caller and cache behavior to understand how an empty JsonNode is stored after a SQL error. Done means a failed drilldown does not produce a cacheable empty report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100