MetPX / sarracenia

https://MetPX.github.io/sarracenia
GNU General Public License v2.0
44 stars 22 forks source link

sr3 can't download messages that are posted with a random checksum #1141

Closed reidsunderland closed 1 month ago

reidsunderland commented 2 months ago

When consuming a v2 message with checksum mode 0 (random), and presumably sr3 messages with checksum mode random, sr3 fails to download.

Example message posted by v2:

2024-07-25 19:37:11,499 [INFO] post_log notice=20240725193709.481324434
http://fdasfdsafsdafsda/
/20240725/NOAA-NCEP/RADAR_US/NEXRAD3/DAA/19/OTX_DAA:NOAAPORT2:CMC:RADAR_US:BIN:20240725193646 headers={'to_clusters': 'DDI,DDSR', 'mtime': '20240725193707.14303875', 'atime': '20240725193707.14303875', 'mode': '664', 'parts': '1,4272,1,0,0',
'sum': '0,0542', 'source': 'NOAA-NCEP', 'from_cluster': 'DDSR.CMC'}

Causes this error:

2024-07-25 19:37:29,080 [ERROR] sarracenia.flow download could not get OTX_DAA:NOAAPORT2:CMC:RADAR_US:BIN:20240725193646: 'Random' object has no attribute 'update'

The Random identity class doesn't implement update. https://github.com/MetPX/sarracenia/blob/development/sarracenia/identity/random.py

The documentation says update is a required method: https://github.com/MetPX/sarracenia/blob/6ef61f6ba0358ba5ef3c994b4da1c8219efe95fc/sarracenia/identity/__init__.py#L35-L51

The tests should also get updated to match: https://github.com/MetPX/sarracenia/tree/development/tests/sarracenia/identity

Maybe @mshak2 can look at this one? I can help.

reidsunderland commented 1 month ago

adding identity cod,sha512 to the config file of the subscriber works around the issue.

petersilva commented 1 month ago

I think all you need is:


def update(self, chunk):
     pass

in the sarracenia/identity/random.py to fix the bug. The most work is testing it.

petersilva commented 1 month ago

@mshak2 can you just prepare the patch to random, and to a PR.... I'm pretty sure that will fix it, and even if it isn't tested, it will do no harm.