ed-pilots-network / backend

Project to consume the Kafka, process the messages and provide an API to access the data
Apache License 2.0
12 stars 5 forks source link

153-Database-Connection-BugFix #154

Closed Daniel-J-Mason closed 6 months ago

Daniel-J-Mason commented 6 months ago

First revision to try and correct connection bug.

Trade module IMC was throwing primary key conflicts as duplicate requests were being logged to the table in certain parallel processing cases.

This was due to backend checking with databse before insert, in that turn around time multple requests were stacking for the same system/station combo. Updated to match exploration IMC and regular databases to createIfNotExists allowing the database to handle ON CONFLICT cases itself.

This was likely slowly consuming the full connection pool which locked the rest of the system from continuing to interact with the database. This change is a needed fix regardless of whether its the true root causes of the larger issue.