sc3 / cookcountyjail

A Django app that tracks the population of Cook County Jail over time and summarizes trends.
http://cookcountyjail.recoveredfactory.net/api/1.0/?format=json
Other
31 stars 23 forks source link

Terminate the scraper if a there is a code fault in one of the modules #442

Open nwinklareth opened 10 years ago

nwinklareth commented 10 years ago

This morning during a run, when the CSV writer was executing a program exception was thrown. This was not caught by scraper code, it was caught by the greenlet code, which terminated the task. The terminated task was the backend task, which meant that all of the database requests were queued up, which balloned the memory usage of the process. This behaviour is wrong.

Modules in the scraper should terminate when code exceptions occur or when other drastic events occur. They should report the event as part of the termination process.