Skip to content

Commit 99b0f9a

Browse files
authored
chore: Add code explanation in some long-running operations (#3390)
* document project_ip_access_list Create * no need to wait in network_container Delete * Revert "no need to wait in network_container Delete" This reverts commit 1e4224f. * document network_container Delete * remove timeouts attribute in mongodbatlas_privatelink_endpoint_service_data_federation_online_archive * Revert "remove timeouts attribute in mongodbatlas_privatelink_endpoint_service_data_federation_online_archive" This reverts commit bff9dc0. * comment timeouts in mongodbatlas_privatelink_endpoint_service_data_federation_online_archive
1 parent a2606fc commit 99b0f9a

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

internal/service/networkcontainer/resource_network_container.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ func resourceRefreshFunc(ctx context.Context, d *schema.ResourceData, client *ad
336336
return nil, "provisioned_container", nil
337337
}
338338

339+
// Atlas Delete is called inside refresh to retry when error: HTTP 409 Conflict (Error code: "CONTAINERS_IN_USE").
339340
_, err = client.NetworkPeeringApi.DeletePeeringContainer(ctx, projectID, containerID).Execute()
340341
if err != nil {
341342
return nil, "provisioned_container", nil

internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func Resource() *schema.Resource {
7070
Computed: true,
7171
},
7272
},
73+
// Timeouts are not being used but kept to avoid breaking changes.
7374
Timeouts: &schema.ResourceTimeout{
7475
Create: schema.DefaultTimeout(2 * time.Hour),
7576
Delete: schema.DefaultTimeout(2 * time.Hour),

internal/service/projectipaccesslist/resource_project_ip_access_list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func (r *projectIPAccessListRS) Create(ctx context.Context, req resource.CreateR
6969
Target: []string{"created", "failed"},
7070
Refresh: func() (any, string, error) {
7171
_, _, err := connV2.ProjectIPAccessListApi.CreateProjectIpAccessList(ctx, projectID, NewMongoDBProjectIPAccessList(projectIPAccessListModel)).Execute()
72+
// Atlas Create is called inside refresh because this limitation: This endpoint doesn't support concurrent POST requests. You must submit multiple POST requests synchronously.
7273
if err != nil {
7374
if strings.Contains(err.Error(), "Unexpected error") ||
7475
strings.Contains(err.Error(), "UNEXPECTED_ERROR") ||

0 commit comments

Comments
 (0)