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

Resolve buger/gor#300 : respect timestamps when replaying requests #308

Merged

Conversation

ylegat
Copy link
Contributor

@ylegat ylegat commented Jun 17, 2016

When Gor deals with multiple input files, it sorts them and replay their requests file after file.
This behavior is not convenient and should be changed. We should respect timestamps order when replaying requests.

ts, _ := strconv.ParseInt(string(meta[2]), 10, 64)
if fileInputReader.meta[0][0] == ResponsePayload {
return fileInputReader
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if block ends with a return statement, so drop this else and outdent its block

When Gor deals with multiple input files, it sorts them and replay their requests file after file.
This behavior is not convenient and should be changed. We should respect timestamps order when replaying requests.
@ylegat ylegat force-pushed the feature/respect_timestamps_when_replaying_requests branch from 807ff89 to 9e7351d Compare June 17, 2016 09:53
@ylegat
Copy link
Contributor Author

ylegat commented Jun 20, 2016

Additional note
I just realized that, with this refactoring, a response can be read and sent way before its related request because of the way we write in files. So, if we have a response at the beginning of one of the input files, it will be read and sent first.
I don't think it is an issue, at least not with middlewares because we know that the order of the request / response is not guarantee, but i'm not 100% sure for the rest of the app. What do you think ?

buger added a commit that referenced this pull request Jun 29, 2016
@buger buger merged commit 9e7351d into buger:master Jun 29, 2016
@buger
Copy link
Owner

buger commented Jun 29, 2016

Sorry for the delay! I made few changes (mostly refactoring to more idiomatic Go, and few race fixes), and merged PR. Thank you!

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