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 proper error handling around sync resources #1393

Merged
merged 5 commits into from
Aug 11, 2020

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Jul 2, 2020

Fixes #1104

This adds error handling around sync resources. It's a shortcut for #1379 with only a fragment embracing the error handling.

@ethouris ethouris added [core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code labels Jul 2, 2020
@ethouris ethouris added this to the v1.5.0 - Sprint 19 milestone Jul 2, 2020
@ethouris ethouris self-assigned this Jul 27, 2020
@maxsharabayko maxsharabayko modified the milestones: v1.5.0 - Sprint 19, v1.5.0 - Sprint 20 Jul 27, 2020
@ethouris
Copy link
Collaborator Author

CodeFactor to ignore: Complex code in api.cpp.

srtcore/sync.cpp Outdated Show resolved Hide resolved
{
gp = &newGroup(gtp);
}
catch (...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Waiting for any certain exception or any?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably only system exceptions and those freshly added here (although "added" is only in order to comply with the C++ std version).

srtcore/api.cpp Outdated Show resolved Hide resolved
@@ -2827,7 +2843,7 @@ SRTSOCKET CUDT::createGroup(SRT_GROUP_TYPE gt)
{
return APIError(e);
}
catch (const std::bad_alloc& e)
catch (...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why bad_alock was not enough there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There could be some other types of exceptions thrown from the C++ standard library, as I remember. All of them qualify as IPE or at best lethal state of the system resources.

@mbakholdina mbakholdina modified the milestones: v1.5.0 - Sprint 20, v1.5.0 - Sprint 21 Aug 10, 2020
@maxsharabayko maxsharabayko merged commit c88ff88 into Haivision:master Aug 11, 2020
@mbakholdina mbakholdina modified the milestones: v1.5.0 - Sprint 21, v1.4.2 Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Priority: High Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completion of error handling
3 participants