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

Added health check for connections from SSP #374

Merged
merged 2 commits into from
Sep 17, 2019

Conversation

eidekrist
Copy link
Member

This fixes #336 with better handling of invalid connections specified in SystemStructure.ssd.

The direct map lookup (i.e. val = map[key]) used in the previous solution could give some funky results, and might even create a valid but unintended connection.

I added a try-catch around the call to execution::add_connection() creating a more detailed and hopefully understandable error message. I'm not sure if this is how we want to do things, so input is welcome.

@eidekrist eidekrist added the bug Something isn't working label Sep 17, 2019
@markaren
Copy link
Contributor

I tested with invalid endElement and endConnector. Did not notice a difference?

@eidekrist
Copy link
Member Author

eidekrist commented Sep 17, 2019

I tested with invalid endElement and endConnector. Did not notice a difference?

As in nothing happened, or exception is thrown both for old and new solution?

A test case could be the first connection for cse-demos/house:

<ssd:Connection startElement="OuterWall1" startConnector="h_wall" endElement="Room1" endConnector="h_OuterWall"/>

When specifying wrong/nonexistent startElement, the old solution would give you a default entry in the slaves map, resulting in a connection from Clock:Clock to Room1:h_Outerwall. The proposed changes will throw an exception.

@markaren
Copy link
Contributor

https://gist.github.com/markaren/bb97bd40e2bce6ca2be9775001f0205c

Thats the output from the debug build. As before the simulations just silently fails and hangs at the end. No exceptions. No error message.

@markaren
Copy link
Contributor

I removed use of fmu-proxy FMUs, just to see if that had something to do with it. But same result.

@markaren
Copy link
Contributor

markaren commented Sep 17, 2019

Ok, I guess it has to do with the FMUs used by the gunnerus-case. They do not shutdown properly, so the application hangs and the user never gets the error message..

Because I get the correct error handling when loading the demo case in the data folder.

Copy link
Member

@kyllingstad kyllingstad left a comment

Choose a reason for hiding this comment

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

Approved in mob session.

@eidekrist eidekrist merged commit 58a440f into master Sep 17, 2019
@eidekrist eidekrist deleted the bugfix/336-invalid-connections-not-handled branch September 17, 2019 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid connections in SSP are not properly handled
3 participants