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

ref(actix): Migrate ProjectUpstream to relay_system::Service #1727

Merged
merged 18 commits into from
Jan 18, 2023

Conversation

olksdr
Copy link
Contributor

@olksdr olksdr commented Dec 30, 2022

Remove actix actor implementation and replace it with relay_system::Service.

Also replaces old futures01 with new futures, and use tokio::spawn to schedule the task which fetches the ProjectState's from upstream. In order to do that I had to change how the scheduling is working, so the entire service won't be blocking:

  • introduces the internal state channel
  • use messages to pass the current state around, like reset the backoff
    period or schedule the another fetch
  • the internal message have also higher priority right now

closes: #1607

#skip-changelog

Remove actix actor implementation and replace it with
`relay_system::Service`.

Also replaces old `futures01` with new `futures`, and use `tokio::spawn`
to schedule the task which fetches the `ProjectState`'s from upstream.
In order to do that I had to change how the scheduling is working, so
the entire service won't be blocking:

* introduces the internal state channel
* use messages to pass the current state around, like reset the backoff
  period or schedule the another fetch
* the internal message have also higher priority right now
@olksdr olksdr self-assigned this Dec 30, 2022
@olksdr olksdr marked this pull request as ready for review January 3, 2023 14:43
@olksdr olksdr requested a review from a team January 3, 2023 14:43
@olksdr olksdr requested review from a team as code owners January 11, 2023 13:43
@olksdr olksdr removed request for a team January 11, 2023 13:46
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Makes sense to me, but I would be more comfortable with a second approval.

relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
* split big functions into smaller pieces
* use SleapHandler insted of tokio::sleep
* use the dedicated struct and type for the upstream response
@olksdr olksdr requested a review from jan-auer January 17, 2023 09:26
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
relay-server/src/actors/project_upstream.rs Outdated Show resolved Hide resolved
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

:shipit:

@jan-auer jan-auer merged commit a30b6d6 into master Jan 18, 2023
@jan-auer jan-auer deleted the ref/proj-upstream-tokio branch January 18, 2023 11:20
jan-auer added a commit that referenced this pull request Jan 18, 2023
* master: (35 commits)
  ref(actix): Migrate ProjectUpstream to `relay_system::Service` (#1727)
  feat(general): Add unknown SessionStatus variant (#1736)
  ref: Convert integration tests about dropping transactions to unit tests (#1720)
  release: 0.8.16
  ci: Skip redundant self-hosted E2E on library release (#1755)
  doc(changelog): Add relevant changes to python changelog (#1753)
  feat(profiling): Add profile context (#1748)
  release: 23.1.0
  profiling(fix): use an unpadded base64 encoding (#1749)
  Revert "feat(replays): Enable PII scrubbing for all organizations" (#1747)
  feat: Switch from base64 to data-encoding (#1743)
  instr(replays): Add timer metric to recording processing (#1742)
  feat(replays): Use Annotated struct definition for replay-event parsing (#1582)
  feat(sessions): Retire session duration metric (#1739)
  feat(general): Scrub all fields with IP address (#1725)
  feat(replays): Enable PII scrubbing for all organizations (#1678)
  chore(project): Add backoff mechanism for fetching projects (#1726)
  feat(profiling): Add new measurement units for profiling (#1732)
  chore(toolchain): update rust to 1.66.1 (#1735)
  ref(actix): Migrate server actor to the "service" arch (#1723)
  ...
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.

Update ProjectUpstream Actor
3 participants