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

Post to /api/ipam/prefixes/<int:pk>/available-ips/ is slow when the prefix is large #14026

Closed
tobiasge opened this issue Oct 12, 2023 · 1 comment · Fixed by #14027
Closed
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@tobiasge
Copy link
Member

tobiasge commented Oct 12, 2023

NetBox version

v3.6.3

Python version

3.11

Steps to Reproduce

  1. Create large prefix (e. g. 10.0.0.0/8)
  2. Request an IP from the created prefix with:
    curl -v -X POST -d '{}' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Token REDACTED' http://localhost:8787/api/ipam/prefixes/$idOfPrefixFromStep1/available-ips/

Expected Behavior

Get a fast response

Observed Behavior

Response takes over 30 seconds

@tobiasge tobiasge added the type: bug A confirmed report of unexpected behavior in the application label Oct 12, 2023
@tobiasge
Copy link
Member Author

I think the bug is caused by the missing limit parameter for get_available_objects in AvailableObjectsView.post in netbox/ipam/api/views.py

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Oct 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants