14
14
limitations under the License.
15
15
*/
16
16
17
- use std:: { env:: current_dir, sync:: Arc } ;
17
+ use std:: { env:: current_dir, sync:: Arc , time :: Duration } ;
18
18
19
19
use :: runc:: options:: DeleteOpts ;
20
20
use async_trait:: async_trait;
@@ -27,7 +27,7 @@ use containerd_shim::{
27
27
event:: Event ,
28
28
io_error,
29
29
monitor:: { Subject , Topic } ,
30
- protos:: { events:: task:: TaskExit , protobuf:: MessageDyn , ttrpc:: context:: with_timeout } ,
30
+ protos:: { events:: task:: TaskExit , protobuf:: MessageDyn , ttrpc:: context:: with_duration } ,
31
31
util:: {
32
32
convert_to_timestamp, read_options, read_pid_from_file, read_runtime, read_spec, timestamp,
33
33
write_str_to_file,
@@ -228,7 +228,7 @@ async fn forward(
228
228
// Prevent event reporting from taking too long time.
229
229
// Learnd from goshim's containerd/runtime/v2/shim/publisher.go
230
230
publisher
231
- . publish ( with_timeout ( 5000000000 ) , & topic, & ns, e)
231
+ . publish ( with_duration ( Duration :: from_secs ( 5 ) ) , & topic, & ns, e)
232
232
. await
233
233
. unwrap_or_else ( |e| warn ! ( "publish {} to containerd: {}" , topic, e) ) ;
234
234
}
0 commit comments