fishcharlie / AirportStatusBot

This is a social media bot that will post delay information for airports in the United States.
MIT License
0 stars 0 forks source link

Weird threading or race condition problem, maybe #13

Open stucka opened 5 months ago

stucka commented 5 months ago

Screenshot_20240405-114219

fishcharlie commented 5 months ago

@stucka Sadly, at first glance this looks to be an FAA issue.

At 15:16:59 UTC time:

<AIRPORT_STATUS_INFORMATION><Update_Time>Fri Apr 5 15:16:39 2024 GMT</Update_Time><Dtd_File>http://www.fly.faa.gov/AirportStatus.dtd</Dtd_File><Delay_type><Name>Ground Stop Programs</Name><Ground_Stop_List><Program><ARPT>JFK</ARPT><Reason>other</Reason><End_Time>11:30 am EDT</End_Time></Program><Program><ARPT>EWR</ARPT><Reason>other</Reason><End_Time>11:30 am EDT</End_Time></Program></Ground_Stop_List></Delay_type><Delay_type><Name>Airport Closures</Name><Airport_Closure_List><Airport><ARPT>LAS</ARPT><Reason>!LAS 03/098 LAS AD AP CLSD TO NON SKED TRANSIENT GA ACFT EXC PPR 702-261-7775 2403132300-2405152300</Reason><Start>Mar 13 at 23:00 UTC.</Start><Reopen>May 15 at 23:00 UTC.</Reopen></Airport><Airport><ARPT>BOS</ARPT><Reason>!BOS 04/076 BOS AD AP CLSD TO NON SKED TRANSIENT GA ACFT EXC ACFT WINGSPAN LESS THAN 80FT 2HR PPR 617-561-2500 2404032012-2404102000</Reason><Start>Apr 03 at 20:12 UTC.</Start><Reopen>Apr 10 at 20:00 UTC.</Reopen></Airport></Airport_Closure_List></Delay_type></AIRPORT_STATUS_INFORMATION>

As you can see, EWR exists with an end time of 11:30.

At 15:18:00 UTC time:

<AIRPORT_STATUS_INFORMATION><Update_Time>Fri Apr 5 15:17:33 2024 GMT</Update_Time><Dtd_File>http://www.fly.faa.gov/AirportStatus.dtd</Dtd_File><Delay_type><Name>Ground Stop Programs</Name><Ground_Stop_List><Program><ARPT>JFK</ARPT><Reason>other</Reason><End_Time>11:30 am EDT</End_Time></Program></Ground_Stop_List></Delay_type><Delay_type><Name>Airport Closures</Name><Airport_Closure_List><Airport><ARPT>LAS</ARPT><Reason>!LAS 03/098 LAS AD AP CLSD TO NON SKED TRANSIENT GA ACFT EXC PPR 702-261-7775 2403132300-2405152300</Reason><Start>Mar 13 at 23:00 UTC.</Start><Reopen>May 15 at 23:00 UTC.</Reopen></Airport><Airport><ARPT>BOS</ARPT><Reason>!BOS 04/076 BOS AD AP CLSD TO NON SKED TRANSIENT GA ACFT EXC ACFT WINGSPAN LESS THAN 80FT 2HR PPR 617-561-2500 2404032012-2404102000</Reason><Start>Apr 03 at 20:12 UTC.</Start><Reopen>Apr 10 at 20:00 UTC.</Reopen></Airport></Airport_Closure_List></Delay_type></AIRPORT_STATUS_INFORMATION>

EWR doesn't exist at all there.

Then at 15:19:02 UTC time:

<AIRPORT_STATUS_INFORMATION><Update_Time>Fri Apr 5 15:18:26 2024 GMT</Update_Time><Dtd_File>http://www.fly.faa.gov/AirportStatus.dtd</Dtd_File><Delay_type><Name>Ground Stop Programs</Name><Ground_Stop_List><Program><ARPT>JFK</ARPT><Reason>other</Reason><End_Time>11:30 am EDT</End_Time></Program><Program><ARPT>EWR</ARPT><Reason>other</Reason><End_Time>12:30 pm EDT</End_Time></Program></Ground_Stop_List></Delay_type><Delay_type><Name>Airport Closures</Name><Airport_Closure_List><Airport><ARPT>LAS</ARPT><Reason>!LAS 03/098 LAS AD AP CLSD TO NON SKED TRANSIENT GA ACFT EXC PPR 702-261-7775 2403132300-2405152300</Reason><Start>Mar 13 at 23:00 UTC.</Start><Reopen>May 15 at 23:00 UTC.</Reopen></Airport><Airport><ARPT>BOS</ARPT><Reason>!BOS 04/076 BOS AD AP CLSD TO NON SKED TRANSIENT GA ACFT EXC ACFT WINGSPAN LESS THAN 80FT 2HR PPR 617-561-2500 2404032012-2404102000</Reason><Start>Apr 03 at 20:12 UTC.</Start><Reopen>Apr 10 at 20:00 UTC.</Reopen></Airport></Airport_Closure_List></Delay_type></AIRPORT_STATUS_INFORMATION>

EWR exists again with an end time of 12:30 pm.


I wish I understood more about how the FAA handles this API. It seems like instead of just updating the entry they completely remove it, then re-add it?? Maybe as a result of some legacy system (if I had to guess).

Obviously the best way to handle this would be if the FAA would provide unique IDs for each event.

I guess we could also either not refresh the data as quickly, or wait for a few runs to see if it gets re-added or if it truly was deleted. But either one of those options would add latency to posts.


Any feedback or ideas would be appreciated.