paritytech / cachepot

cachepot is `sccache` with extra sec, which in turn is `ccache` with cloud storage
https://cachepot.cc
Apache License 2.0
171 stars 15 forks source link

Streamline dist client state management and prune remaining `reqwest::blocking` client #91

Closed Xanewok closed 3 years ago

Xanewok commented 3 years ago

This is an attempt to fix #85 (and is an overdue cleanup).

First 3 commits do the aforementioned streamlining, while the remaining commits prune the remaining blocking reqwest client. Since we can now leverage streaming bodies in async client, there's no need to fallback to the blocking implementation. This should have a side-benefit of not constructing any blocking/runtime machinery while we're in an async context - this, ultimately, should prevent us from hitting the panics mentioned in #85.

I couldn't reasonably reproduce the issue from #85, so @drahnr let me know if that fixes things for you (and let's see what CI has to say first since I didn't run too much tests locally yet).

Xanewok commented 3 years ago

We do not block_on anymore in get_client due to new async interface in ecba086663c43abcfcc323389bc45b8fd297e844 (which caused panics when executed in the task context) and added a note wrt deadlock-safety in 8ebef65d3f001696cada74b40bf043f98b376f0b.