projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.04k stars 95 forks source link

fluent-fallback-cache: Fix waiting from multiple tasks. #224

Closed emilio closed 3 years ago

emilio commented 3 years ago

The cache effectively multiplexes a stream, so we can't just rely on the stream receiving end to wake up all the relevant tasks.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1613705#c56 for me.

Disclaimer: I'm not the most familiar with async rust, so take with a grain of salt.

emilio commented 3 years ago

There's a bunch of unsafe in this file which could get some comments about why it's sound btw.

zbraniecki commented 3 years ago

@djg - can you take a look at if this seems like the right fix for the issue I encountered in https://bugzilla.mozilla.org/show_bug.cgi?id=1613705#c56 ?

zbraniecki commented 3 years ago

Thank you @emilio!