Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

mnoomnoo
Copy link
Contributor

@mnoomnoo mnoomnoo commented Mar 10, 2024

#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
src/mtconnect/buffer/circular_buffer.hpp Outdated Show resolved Hide resolved
@wsobel
Copy link
Member

wsobel commented Mar 19, 2024

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
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
Copy link
Member

wsobel commented Mar 20, 2024 via email

@wsobel wsobel merged commit 553da0d into mtconnect:main Mar 20, 2024
7 checks passed
@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