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

feat: add filter for actor changes #1195

Merged
merged 9 commits into from
May 15, 2023

Conversation

Terryhung
Copy link
Collaborator

This feature can help prevent this issue from occurring again.

By modifying the environment variable: LILY_ACTOR_CHANGE_LIMITER, it is able to adjust the threshold.

@Terryhung Terryhung marked this pull request as ready for review May 8, 2023 15:58
const defaultActorChangeLimit = 10000

// Skip task processing when actor state changes abnormally.
func (t *Task) exceedActorChangeLimit(changes map[address.Address]tasks.ActorStateChange) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: exceedsActorChangeLimit

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

.gitignore Outdated
@@ -21,3 +21,5 @@ visor
build/.*
support/tools/bin

# Deployment
deployment/.env
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
deployment/.env
.env

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We will put the .env file in the deployment folder because of docker-compose usage, therefore we should add the gitignore here 😄 .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I change it to *.env.

Copy link
Contributor

Choose a reason for hiding this comment

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

Simply doing .env would ignore it in all paths instead of *.env which would only ignore in the root path. If we do hyperspecific paths like so, we could face the same problem again where the secrets are revealed.

limit := defaultActorChangeLimit

// Access the custom threshold set in the environment variable
s := os.Getenv(actorChangeLimiterEnv)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
s := os.Getenv(actorChangeLimiterEnv)
s := os.Getenv(actorChangeLimiterEnv)

os.LookupEnv might be nicer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nice

Copy link
Contributor

@kasteph kasteph left a comment

Choose a reason for hiding this comment

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

*.env will not match paths that

.gitignore Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@Terryhung Terryhung requested a review from kasteph May 12, 2023 06:49
@birdychang birdychang merged commit 51e7c41 into master May 15, 2023
@birdychang birdychang deleted the terryhung/add-filter-for-actor-changes branch May 15, 2023 05:08
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.

3 participants