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

fix: topology request during setup is blocking the MainThread, hanging until timeout #77

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

viniarck
Copy link
Collaborator

@viniarck viniarck commented Nov 7, 2024

Closes #75

Summary

  • Avoid blocking setup() when loading topology by moving it to handle kytos/topology.topology_loaded

Local Tests

  • Loaded this NApp and observed kytos/topology.topology_loaded and kytos/topology.updated, it loaded correctly without also the request timeout on setup()

2024-11-07 13:41:38,541 - INFO [kytos.core.controller] (MainThread) Loading NApp kytos/sdx
2024-11-07 13:41:38,542 - INFO [kytos.core.napps.base] (of_multi_table) Running NApp: <Main(of_multi_table, started 140441320150720)>
2024-11-07 13:41:38,555 - INFO [kytos.core.napps.base] (sdx) Running NApp: <Main(sdx, started 140441311758016)>
2024-11-07 13:41:38,556 - INFO [kytos.core.api_server] (MainThread) Started /api/kytos/sdx/topology/2.0.0 - GET
2024-11-07 13:41:38,556 - INFO [kytos.core.api_server] (MainThread) Started /api/kytos/sdx/topology/2.0.0 - POST
2024-11-07 13:41:38,557 - INFO [kytos.core.api_server] (MainThread) Started /api/kytos/sdx/l2vpn/1.0 - POST
2024-11-07 13:41:38,557 - INFO [kytos.core.api_server] (MainThread) Started /api/kytos/sdx/l2vpn/1.0/{service_id} - PATCH



kytos $> assert controller.napps[('kytos', 'sdx')]._topo_dict["links"]

kytos $> assert controller.napps[('kytos', 'sdx')]._converted_topo["links"]

kytos $> controller.napps[('kytos', 'sdx')].sdx_topology
Out[5]: 
{'_id': 'topology',
 'timestamp': '2024-11-07T16:41:43Z',
 'updated_at': datetime.datetime(2024, 11, 7, 16, 41, 43, 635379),
 'version': 3}

End-to-End Tests

N/A

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11727522039

Details

  • 6 of 7 (85.71%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.9%) to 77.512%

Changes Missing Coverage Covered Lines Changed/Added Lines %
main.py 6 7 85.71%
Files with Coverage Reduction New Missed Lines %
main.py 4 72.65%
Totals Coverage Status
Change from base Build 10990547959: -0.9%
Covered Lines: 486
Relevant Lines: 627

💛 - Coveralls

Copy link
Collaborator

@italovalcy italovalcy left a comment

Choose a reason for hiding this comment

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

LGTM! thanks for the PR, Vinicius! amazing to see this change!

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.

bug: topology request during setup is blocking the MainThread, hanging until timeout
3 participants