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.2
Milestone

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

@turnerrainer turnerrainer added bug Something isn't working enhancement New feature or request labels Jan 22, 2024
@turnerrainer turnerrainer moved this to To Groom in Ruuter | Bükstack Jan 22, 2024
@turnerrainer turnerrainer moved this to To Groom in Bürokratt Sprint Jan 22, 2024
@rasmusei rasmusei moved this from To Groom to In Progress in Bürokratt Sprint Oct 15, 2024
@turnerrainer turnerrainer removed the enhancement New feature or request label Oct 21, 2024
@rasmusei rasmusei added the v2.1 label Feb 3, 2025
@rasmusei rasmusei modified the milestones: Ruuter v2.1, BYK v2.1 Feb 3, 2025
@rasmusei rasmusei added v2.2 and removed v2.1 labels Feb 19, 2025
@rasmusei rasmusei modified the milestones: BYK v2.1, BYK v2.2 Feb 19, 2025
@rasmusei rasmusei moved this from In Progress to Ready in Bürokratt Sprint Feb 26, 2025
@rasmusei rasmusei removed the v2.0.2 label Mar 14, 2025
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.2
Projects
Status: Ready
Status: To Groom
Development

No branches or pull requests

3 participants