MathematicalMedicine / diver-issues

Semipublic tracking of issues for the DIVER front end
0 stars 0 forks source link

TEMP_AECIds can leave behind evil debris if a custom variable creation attempt fails #217

Closed Viqsi closed 8 months ago

Viqsi commented 8 months ago

TEMP_AECIds is a temporary table in API_BuildALLEXISTSCohort, used to keep track of what variables are contributing to the custom variable we're generating an AEC for and their accompanying AEC IDs. It is presently not cleaned out at the start of each run, and this means that if some custom variable creation fails, this table is still out there ready to cause mischief until it's removed (typically by restarting diverRPC and thus getting a new database connection).

This has caused us quite a bit of grief while testing stuff, and so one would think we'd just wipe the table each time. Except doing that was causing problems elsewhere, so we'd need to pin down why that is.

From @WValenti in Skype:

TEMP_AECIDs is accumulating results in the recursive process, and a DROP TABLE for it was causing problems. This works fine until something blows-up leaving it with debris. This is an error-handling problem that can also be addressed by the rewrite that [@Viqsi] proposed. [#149]

Viqsi commented 8 months ago

Faced with the prospect of Hypothetical Returning Bugs Eventually versus Actual Troublesome Bugs Now, we opted to just go ahead and truncate the table on each initial invocation of API_BuildALLEXISTSCohort. If there's side effects, we'll deal with them as separate issues.