Skip to content

Serialize writes of JSON playlist#1932

Merged
darkdarkdragon merged 3 commits intomasterfrom
it/playlist-save
Jul 22, 2021
Merged

Serialize writes of JSON playlist#1932
darkdarkdragon merged 3 commits intomasterfrom
it/playlist-save

Conversation

@darkdarkdragon
Copy link
Copy Markdown
Contributor

@darkdarkdragon darkdarkdragon commented Jun 26, 2021

What does this pull request do? Explain your changes. (required)
Fixes Error saving json playlist error.
We're making a lot of writes (to object store) to same json playlist file during stream.
Each write starts in own goroutine, so often new writes starts before previous completed.
In that case request to Google Cloud Storage often takes more than 10s, which is our timeout.
This PR fixes problem by serializing write requests.

Specific updates (required)

  • Create new OvewriteQueue class that serializes writes to the same file in OS.
  • Use OvewriteQueue for writing JSON playlists.

How did you test each of these updates (required)
Unit tests

Does this pull request close any open issues?
Fixes #1924

Checklist:

@darkdarkdragon darkdarkdragon force-pushed the it/playlist-save branch 2 times, most recently from 4e0618e to f7ae625 Compare June 29, 2021 19:27
@darkdarkdragon darkdarkdragon force-pushed the it/playlist-save branch 4 times, most recently from 9f70115 to 9dd88db Compare July 6, 2021 20:56
Copy link
Copy Markdown
Contributor

@jailuthra jailuthra left a comment

Choose a reason for hiding this comment

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

Before merge, would it be feasible to test it out in a local dev environment and/or staging, aside from the unit tests?

LGTM otherwise. Will let somebody else mark it as approved, as this is my first dive into this part of the codebase.

Copy link
Copy Markdown
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

@darkdarkdragon darkdarkdragon merged commit bd8d45e into master Jul 22, 2021
@darkdarkdragon darkdarkdragon deleted the it/playlist-save branch July 22, 2021 18:04
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.

Investigate "Error saving json playlist" errors.

3 participants