Skip to content

Add the strictMode option to not terminate the current ripley session if an invalid HTTP request is received #6

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

Merged
merged 4 commits into from
Oct 4, 2022

Conversation

eugenepaniot
Copy link
Contributor

Do not break session if got invalid HTTP Method

@eugenepaniot eugenepaniot changed the title Do not break session if got invalid HTTP Method Do not break session if got invalid HTTP request Sep 23, 2022
Copy link
Contributor

@georgemalamidis-lh georgemalamidis-lh left a comment

Choose a reason for hiding this comment

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

@eugenepaniot @dwilliams782 I've thought of this before. The reason for the panic here is to brute force prompt us there is bad input data so that we can take a look at it and fix it, i.e. I think it's useful for ripley to not be resilient here. If we log the error and continue instead, I'm worried we'll never know, unless we explicitly add STDERR checks wherever ripley is used.

@eugenepaniot
Copy link
Contributor Author

@eugenepaniot @dwilliams782 I've thought of this before. The reason for the panic here is to brute force prompt us there is bad input data so that we can take a look at it and fix it, i.e. I think it's useful for ripley to not be resilient here. If we log the error and continue instead, I'm worried we'll never know, unless we explicitly add STDERR checks wherever ripley is used.

If it skips incorrect req and exits with non-zero code, will it be fine? Or input data for ripley has to be properly prepared?

@georgemalamidis-lh
Copy link
Contributor

@eugenepaniot @dwilliams782 I've thought of this before. The reason for the panic here is to brute force prompt us there is bad input data so that we can take a look at it and fix it, i.e. I think it's useful for ripley to not be resilient here. If we log the error and continue instead, I'm worried we'll never know, unless we explicitly add STDERR checks wherever ripley is used.

If it skips incorrect req and exits with non-zero code, will it be fine? Or input data for ripley has to be properly prepared?

That would take care of the cronjob finishing in a Failed state, which is good.
I can't think of many command line tools that continue working when given bad input. Can you think of any? However, we do pass ripley a list of inputs, so maybe it's OK to log, have the cronjob tell us it failed and then we go and investigate the bad data. What's really important for me is to always investigate bad data and the cronjob completely blowing up forces us to do that.
If you think log bad input + non 0 exit code is the best way to go, let's do that.

@eugenepaniot
Copy link
Contributor Author

@eugenepaniot @dwilliams782 I've thought of this before. The reason for the panic here is to brute force prompt us there is bad input data so that we can take a look at it and fix it, i.e. I think it's useful for ripley to not be resilient here. If we log the error and continue instead, I'm worried we'll never know, unless we explicitly add STDERR checks wherever ripley is used.

If it skips incorrect req and exits with non-zero code, will it be fine? Or input data for ripley has to be properly prepared?

That would take care of the cronjob finishing in a Failed state, which is good. I can't think of many command line tools that continue working when given bad input. Can you think of any? However, we do pass ripley a list of inputs, so maybe it's OK to log, have the cronjob tell us it failed and then we go and investigate the bad data. What's really important for me is to always investigate bad data and the cronjob completely blowing up forces us to do that. If you think log bad input + non 0 exit code is the best way to go, let's do that.

For example grep command:

bash-4.4$ grep Name /proc/1/mem  /proc/1/status
grep: /proc/1/mem: Permission denied
/proc/1/status:Name:	systemd

bash-4.4$ echo $?
2

I think it's ok to continue working, in non-critical sections, if possible, but change exitCode.

@eugenepaniot eugenepaniot changed the title Do not break session if got invalid HTTP request Add the strictMode option to not terminate the current ripley session if an invalid HTTP request is received Sep 29, 2022
@eugenepaniot eugenepaniot merged commit 24a7748 into main Oct 4, 2022
@eugenepaniot eugenepaniot deleted the do-not-panic-on-req-err branch October 4, 2022 18:53
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