Skip to content
This repository was archived by the owner on Jul 20, 2024. It is now read-only.

Fix loop that can run infinitely in some cases #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LiranV
Copy link

@LiranV LiranV commented Sep 20, 2023

Inside the runonce.sh script there is the aws ec2 attach-network-interface command,
If it fails (in my case when the interface was not yet released after system check failure and instance termination) the script goes on and then snat.sh will run.

There the while loop will hand as eth1 will never be available due to the previous failure.

This fix will allow the control flow to continue and reach a user provided script which is given via the user_data variable of this module.

@LiranV LiranV changed the title Fix loop that can run infinitly in some cases Fix loop that can run infinitely in some cases Sep 20, 2023
@LiranV LiranV force-pushed the fix-infinite-while-loop-snat branch from 9771977 to 2ed70d9 Compare September 20, 2023 11:03
@roman8422
Copy link

roman8422 commented Nov 13, 2023

Hi @int128 .
I ran into this too. Could you merge this PR to fix this please?
Thanks.

Edit: actually, it doesn't fix the original problem #57. If interface is not attached for some reason, this change will wait for 3 mins and fail and user will have to handle it using var.user_data_runcmd.

Adding retries in runonce.sh is a better solution imo. Created #72 for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants