# Failure to persist footprints with SOURCE_IO_NO_HEAVY_FOOTPRINTS

XMLWordPrintable

#### Details

• Type: Story
• Status: To Do
• Resolution: Unresolved
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
2
• Team:
Data Release Production

#### Description

In DM-9108 we saw that some footprint IDs get "stuck" when being persisted with afwTable.SOURCE_IO_NO_HEAVY_FOOTPRINTS — that is, when persisting a source catalogue, some fraction of the sources are all assigned the same footprint.

We've traced this back to SourceFitsWriter::_writeRecord, and specifically the line:

 if ((_flags & SOURCE_IO_NO_HEAVY_FOOTPRINTS) && footprint->isHeavy()) {  footprint.reset(new afw::detection::Footprint(*footprint)); } 

This attempts to strip “heaviness” off the Footprint before persisting it. However, the pointer allocated to the freshly-stripped Footprint can be the same over multiple calls to this function. However, OutputArchive::Impl::put assumes that each object being persisted to the archive has a unique address. When this uniqueness assumption isn't met, persistence is (silently) skipped.

#### Activity

Hide
John Swinbank added a comment -

Worth adding that it's not guaranteed that the pointer address will be reused between successive calls: sometimes it will be, sometimes it won't, so this bug may be hard to reproduce.

Show
John Swinbank added a comment - Worth adding that it's not guaranteed that the pointer address will be reused between successive calls: sometimes it will be, sometimes it won't, so this bug may be hard to reproduce.
Hide
John Swinbank added a comment - - edited

Workaround until this is fixed is never to run with afwTable.SOURCE_IO_NO_HEAVY_FOOTPRINTS.

Show
John Swinbank added a comment - - edited Workaround until this is fixed is never to run with afwTable.SOURCE_IO_NO_HEAVY_FOOTPRINTS .
Hide

Change the docs to that it doesn't claim to support afwTable.SOURCE_IO_NO_HEAVY_FOOTPRINTS on writing, and raise an exception if attempted.

Show
Yusra AlSayyad added a comment - Change the docs to that it doesn't claim to support afwTable.SOURCE_IO_NO_HEAVY_FOOTPRINTS on writing, and raise an exception if attempted.

#### People

Assignee:
Unassigned
Reporter:
John Swinbank
Watchers: