@@ -136,6 +136,8 @@ impl KVStore for VssStore {
136136 store_id : self . store_id . clone ( ) ,
137137 key : self . build_key ( primary_namespace, secondary_namespace, key) ?,
138138 } ;
139+
140+ println ! ( "READ: {}/{}/{}" , primary_namespace, secondary_namespace, key) ;
139141 let resp = self . runtime . block_on ( self . client . get_object ( & request) ) . map_err ( |e| {
140142 let msg = format ! (
141143 "Failed to read from key {}/{}/{}: {}" ,
@@ -146,6 +148,7 @@ impl KVStore for VssStore {
146148 _ => Error :: new ( ErrorKind :: Other , msg) ,
147149 }
148150 } ) ?;
151+ println ! ( "READ DONE: {}/{}/{}" , primary_namespace, secondary_namespace, key) ;
149152 // unwrap safety: resp.value must be always present for a non-erroneous VSS response, otherwise
150153 // it is an API-violation which is converted to [`VssError::InternalServerError`] in [`VssClient`]
151154 let storable = Storable :: decode ( & resp. value . unwrap ( ) . value [ ..] ) . map_err ( |e| {
@@ -176,14 +179,28 @@ impl KVStore for VssStore {
176179 delete_items : vec ! [ ] ,
177180 } ;
178181
179- self . runtime . block_on ( self . client . put_object ( & request) ) . map_err ( |e| {
182+ println ! ( "WRITE: {}/{}/{}" , primary_namespace, secondary_namespace, key) ;
183+ let res = self . runtime . block_on ( async move {
184+ tokio:: time:: timeout ( Duration :: from_secs ( 100 ) , self . client . put_object ( & request) )
185+ . await
186+ . map_err ( |e| {
187+ let msg = format ! (
188+ "Failed to write to key {}/{}/{}: {}" ,
189+ primary_namespace, secondary_namespace, key, e
190+ ) ;
191+ Error :: new ( ErrorKind :: Other , msg)
192+ } )
193+ } ) ;
194+
195+ println ! ( "WRITE DONE: {}/{}/{}: {:?}" , primary_namespace, secondary_namespace, key, res) ;
196+
197+ res?. map_err ( |e| {
180198 let msg = format ! (
181199 "Failed to write to key {}/{}/{}: {}" ,
182200 primary_namespace, secondary_namespace, key, e
183201 ) ;
184202 Error :: new ( ErrorKind :: Other , msg)
185203 } ) ?;
186-
187204 Ok ( ( ) )
188205 }
189206
@@ -200,19 +217,22 @@ impl KVStore for VssStore {
200217 } ) ,
201218 } ;
202219
220+ println ! ( "REMOVE: {}/{}/{}" , primary_namespace, secondary_namespace, key) ;
203221 self . runtime . block_on ( self . client . delete_object ( & request) ) . map_err ( |e| {
204222 let msg = format ! (
205223 "Failed to delete key {}/{}/{}: {}" ,
206224 primary_namespace, secondary_namespace, key, e
207225 ) ;
208226 Error :: new ( ErrorKind :: Other , msg)
209227 } ) ?;
228+ println ! ( "REMOVE DONE: {}/{}/{}" , primary_namespace, secondary_namespace, key) ;
210229 Ok ( ( ) )
211230 }
212231
213232 fn list ( & self , primary_namespace : & str , secondary_namespace : & str ) -> io:: Result < Vec < String > > {
214233 check_namespace_key_validity ( primary_namespace, secondary_namespace, None , "list" ) ?;
215234
235+ println ! ( "LIST: {}/{}" , primary_namespace, secondary_namespace) ;
216236 let keys = self
217237 . runtime
218238 . block_on ( self . list_all_keys ( primary_namespace, secondary_namespace) )
@@ -223,6 +243,7 @@ impl KVStore for VssStore {
223243 ) ;
224244 Error :: new ( ErrorKind :: Other , msg)
225245 } ) ?;
246+ println ! ( "LIST DONE: {}/{}" , primary_namespace, secondary_namespace) ;
226247
227248 Ok ( keys)
228249 }
0 commit comments