Skip to content

DisplayDriverServer: Check merge driver for errors #1461

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

Open
wants to merge 1 commit into
base: RB-10.5
Choose a base branch
from

Conversation

LinasBeres
Copy link

@LinasBeres LinasBeres commented Mar 26, 2025

I added a small test in the merge driver code to make sure that the data coming in is as expected.

Relates to PR #1448.

The incoming merge driver could gave mismatched data, which includes: display window, channel names and # merge drivers requested.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Cortex project's prevailing coding style and conventions.

Checks if the current merge driver is compatible with and incoming merge
driver.
@LinasBeres LinasBeres self-assigned this Mar 31, 2025
Comment on lines +484 to +488
if ( ++m.usageCount > sessionClientsData->readable() )
{
throw IECore::InvalidArgumentException( "Number of merge clients (" + std::to_string( m.usageCount )
+ ") is more than expected amount (" + std::to_string( m.mergeCount ) + ")." );
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems unfortunate that we're testing against sessionClientsData from the new driver here, since we have no guarantee that it has the same value that was used to initialise m.mergeCount in the first place. But we can't test against m.mergeCount either, since that is decremented in imageClose. Can we rejig our two state variables to make this a bit more watertight?

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.

2 participants