Skip to content

Issue-423: Crash when editing device dataitem in DeviceModel - #424

Merged
wsobel merged 4 commits into
mtconnect:mainfrom
mnoomnoo:issue-423
Mar 20, 2024
Merged

Issue-423: Crash when editing device dataitem in DeviceModel#424
wsobel merged 4 commits into
mtconnect:mainfrom
mnoomnoo:issue-423

Conversation

@mnoomnoo

@mnoomnoo mnoomnoo commented Mar 10, 2024

Copy link
Copy Markdown
Contributor

#423

Updated Checkpoint::updateDataItems() to remove orphans from observations map. Updated CircularBuffer::updateDataItems() to remove orphans from m_slidingBuffer

…ions map. Updated CircularBuffer::updateDataItems() to remove orphans from m_slidingBuffer
Comment thread src/mtconnect/buffer/circular_buffer.hpp Outdated
@wsobel

wsobel commented Mar 19, 2024

Copy link
Copy Markdown
Member

We can't erase from the circular buffer since the positions are computed using the sequence numbers. it is better to leave holes. When we get observations from the circular buffer, it skips orphaned observations. The checkpoint code looks correct.

Did you write a test to verify the changes?

@wsobel wsobel linked an issue Mar 19, 2024 that may be closed by this pull request
@wsobel wsobel changed the title Issue-423 Issue-423: Crash when editing device dataitem in DeviceModel Mar 19, 2024
@mnoomnoo
mnoomnoo requested a review from wsobel March 20, 2024 04:32
@mnoomnoo

Copy link
Copy Markdown
Contributor Author

I updated CircularBuffer::updateDataItems() to skip orphaned dataItems instead of deleting them from the sliding buffer. Checkpoint::updateDataItems() still deletes orphaned observations.

Did you write a test to verify the changes?

I didn't write a test to verify the changes. I can take a peek at existing unit tests to see if there is something I can modify to test the agent when data items are added / removed or their IDs are changed.

@wsobel

wsobel commented Mar 20, 2024 via email

Copy link
Copy Markdown
Member

@wsobel
wsobel merged commit 553da0d into mtconnect:main Mar 20, 2024
@mnoomnoo
mnoomnoo deleted the issue-423 branch March 21, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when editing device dataitem in DeviceModel

2 participants