saferwall/saferwall

How to increase MultiAV timeout?

nikAizuddin opened this issue · 4 comments

Hi, is there any way to increase MultiAV timeout? For example, I can't find any timeout related options in https://github.com/saferwall/saferwall/blob/20140b116832d6e7c8f88a344b3acd30fb9291b1/configs/services/multiav/avira/local.toml.

I have a slow VM with small RAM and lots of other pods running. So, when my server is too busy, I'll get:

{"level":"INFO","timestamp":"2022-02-13T10:56:24.880Z","caller":"multiav/multiav.go:126","msg":"start scanning","version":"1.0.0","sha256":"ad14312e134f8b9483b2d701b1470758e8944764ec803252efede6b1c49e9485"}
Command timed out
{"level":"ERROR","timestamp":"2022-02-13T10:56:54.963Z","caller":"multiav/multiav.go:140","msg":"failed to scan file, reason: signal: killed","version":"1.0.0","sha256":"ad14312e134f8b9483b2d701b1470758e8944764ec803252efede6b1c49e9485","stacktrace":"github.com/saferwall/saferwall/services/multiav.(*Service).HandleMessage\n\t/go/src/saferwall/avira/services/multiav/multiav.go:140\ngithub.com/nsqio/go-nsq.(*Consumer).handlerLoop\n\t/go/pkg/mod/github.com/nsqio/go-nsq@v1.0.8/consumer.go:1113"}
{"level":"DEBUG","timestamp":"2022-02-13T10:56:54.973Z","caller":"multiav/multiav.go:149","msg":"finished scanning: output: , infected:false, out: Avira / Linux Version 1.9.161.2\nCopyright (c) 2010 by Avira GmbH\nAll rights reserved.\n\n","version":"1.0.0","sha256":"ad14312e134f8b9483b2d701b1470758e8944764ec803252efede6b1c49e9485"}

Hey @nikAizuddin

Sorry for my late answer.

The timeout is basically hardcoded in a private pkg called multiav, the value is set to 3 seconds. I can externalize the timeout so it can be set from the config. I will make a PR

Hi @LordNoteworthy Is there any progress on configurable timeout? For me I need to set at least 1 minute for all scan to finish and to be safe, I set the them all to 3 minutes.

Easy, I will externalize a variable to control that.

This is now available in a config file.