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

Ruuter mixing up responses when multiple requests in parallel using conditions #256

Open
3 tasks
turnerrainer opened this issue Jan 22, 2024 Discussed in #133 · 0 comments
Open
3 tasks
Assignees
Labels
bug Something isn't working epic v2.0.2

Comments

@turnerrainer
Copy link
Contributor

turnerrainer commented Jan 22, 2024

Important

In case of running multiple simultaneous threads on Ruuter, responses to requests get mixed up at some point

Acceptance Criteria

Discussed in #133

Originally posted by gdrui February 3, 2023
Given an endpoint that fetches different data from Resql based on the provided parameters:

extract_request_data:
  assign:
    requestedMetric: ${incoming.params.metric}

checkMetric:
  switch:
    - condition: ${requestedMetric === 'total_chats_day'}
      next: getTotalChatsDayResults
    - condition: ${requestedMetric === 'total_chats_month'}
      next: getTotalChatsMonthResults
    - condition: ${requestedMetric === 'total_chats_no_csa_day'}
      next: getTotalChatsNoCSAResults
    - condition: ${requestedMetric === 'avg_chats_by_month'}
      next: getAvgChatsMonthResults
    - condition: ${requestedMetric === 'avg_chats_by_week'}
      next: getAvgChatsWeekResults
    - condition: ${requestedMetric === 'avg_chats_no_csa_by_month'}
      next: getAvgChatsNoCSAMonthResult
    - condition: ${requestedMetric === 'avg_chats_no_csa_by_week'}
      next: getAvgChatsNoCSAWeekResult
    - condition: ${requestedMetric === 'avg_waiting_time_day'}
      next: getAvgWaitingTimeDayResult
    - condition: ${requestedMetric === 'avg_waiting_time_week'}
      next: getAvgWaitingTimeWeekResult
    - condition: ${requestedMetric === 'total_forwarded_chats_yesterday'}
      next: getTotalForwardedChatsResult
    - condition: ${requestedMetric === 'chat-activity'}
      next: getChatActivityResult
  next: invalidMetric

If this endpoint is called once with any valid parameter it will return the correct result.
However if many or all of these options are called in parallel requests then sometimes the results get mixed up and for example I can receive the result of avg_waiting_time_day when the request was with the parameter total_chats_day

I also tried to replace the individual steps so that instead of an asynchronous http.post step each step would only return a unique value like :

getTotalChatsDayResults:
  return: 'A'
  next: end
  
getTotalChatsMonthResults:
  return: 'B'
  next: end
...

This seems to happen less frequently like this, but I still observe the same thing happening:

When its OK:
Screenshot 2023-02-03 at 11 21 18
When its not OK:
Screenshot 2023-02-03 at 11 21 15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working epic v2.0.2
Projects
Status: In Progress
Status: To Groom
Development

No branches or pull requests

3 participants