stanstrup / PredRet

Shiny app for retention time prediction
GNU General Public License v2.0
9 stars 6 forks source link

Potential race condition: systems_in_db() called twice #66

Open sneumann opened 8 years ago

sneumann commented 8 years ago

Hi, if at the same time as this call: https://github.com/stanstrup/PredRet/blob/53c62ee956b0c9df002ef204c2a26024aaaae42c/retdb/server/server_upload_tab_process_data.R#L156

somebody inserts a new system, then sys_name and sys_id can be out of sync. Very low priority, but keep in mind "what could possibly go wrong" :-)

sneumann commented 8 years ago

Actually, the line above could use name2sys_oid() from https://github.com/stanstrup/PredRet/blob/master/PredRetR/R/database_queries.R#L203 and there you'd fix the potential race condition.