@@ -57,7 +57,6 @@ enum VssSchemaVersion {
5757// We set this to a small number of threads that would still allow to make some progress if one
5858// would hit a blocking case
5959const INTERNAL_RUNTIME_WORKERS : usize = 2 ;
60- const VSS_IO_TIMEOUT : Duration = Duration :: from_secs ( 5 ) ;
6160
6261/// A [`KVStoreSync`] implementation that writes to and reads from a [VSS](https://github.com/lightningdevkit/vss-server/blob/main/README.md) backend.
6362pub struct VssStore {
@@ -166,16 +165,7 @@ impl KVStoreSync for VssStore {
166165 let inner = Arc :: clone ( & self . inner ) ;
167166 let fut =
168167 async move { inner. read_internal ( primary_namespace, secondary_namespace, key) . await } ;
169- // TODO: We could drop the timeout here once we ensured vss-client's Retry logic always
170- // times out.
171- tokio:: task:: block_in_place ( move || {
172- internal_runtime. block_on ( async move {
173- tokio:: time:: timeout ( VSS_IO_TIMEOUT , fut) . await . map_err ( |_| {
174- let msg = "VssStore::read timed out" ;
175- Error :: new ( ErrorKind :: Other , msg)
176- } )
177- } ) ?
178- } )
168+ tokio:: task:: block_in_place ( move || internal_runtime. block_on ( fut) )
179169 }
180170
181171 fn write (
@@ -205,16 +195,7 @@ impl KVStoreSync for VssStore {
205195 )
206196 . await
207197 } ;
208- // TODO: We could drop the timeout here once we ensured vss-client's Retry logic always
209- // times out.
210- tokio:: task:: block_in_place ( move || {
211- internal_runtime. block_on ( async move {
212- tokio:: time:: timeout ( VSS_IO_TIMEOUT , fut) . await . map_err ( |_| {
213- let msg = "VssStore::write timed out" ;
214- Error :: new ( ErrorKind :: Other , msg)
215- } )
216- } ) ?
217- } )
198+ tokio:: task:: block_in_place ( move || internal_runtime. block_on ( fut) )
218199 }
219200
220201 fn remove (
@@ -243,16 +224,7 @@ impl KVStoreSync for VssStore {
243224 )
244225 . await
245226 } ;
246- // TODO: We could drop the timeout here once we ensured vss-client's Retry logic always
247- // times out.
248- tokio:: task:: block_in_place ( move || {
249- internal_runtime. block_on ( async move {
250- tokio:: time:: timeout ( VSS_IO_TIMEOUT , fut) . await . map_err ( |_| {
251- let msg = "VssStore::remove timed out" ;
252- Error :: new ( ErrorKind :: Other , msg)
253- } )
254- } ) ?
255- } )
227+ tokio:: task:: block_in_place ( move || internal_runtime. block_on ( fut) )
256228 }
257229
258230 fn list ( & self , primary_namespace : & str , secondary_namespace : & str ) -> io:: Result < Vec < String > > {
@@ -265,16 +237,7 @@ impl KVStoreSync for VssStore {
265237 let secondary_namespace = secondary_namespace. to_string ( ) ;
266238 let inner = Arc :: clone ( & self . inner ) ;
267239 let fut = async move { inner. list_internal ( primary_namespace, secondary_namespace) . await } ;
268- // TODO: We could drop the timeout here once we ensured vss-client's Retry logic always
269- // times out.
270- tokio:: task:: block_in_place ( move || {
271- internal_runtime. block_on ( async move {
272- tokio:: time:: timeout ( VSS_IO_TIMEOUT , fut) . await . map_err ( |_| {
273- let msg = "VssStore::list timed out" ;
274- Error :: new ( ErrorKind :: Other , msg)
275- } )
276- } ) ?
277- } )
240+ tokio:: task:: block_in_place ( move || internal_runtime. block_on ( fut) )
278241 }
279242}
280243
0 commit comments