summaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-03-18 14:05:08 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-03-18 14:05:08 +0000
commit9be87dcfc81d88b7aa5df918047ba3ab977b6c3f (patch)
tree069213d8e23e4db28450dd24191a7a17a7c7ed7f /storageapi
parent81dbfb5c6446bb2fa6c54923ff6d77b20815f611 (diff)
Fix visitor manager test TSan mutex inversion warning and refactor deadline handling
Defer starting main message dispatch thread until test has enqueued a message that will be immediately timed out. Avoids having to depend on taking an internal mutex in the test to prevent racing with queue handoffs. Taking said mutex triggered a mutex order inversion warning in TSan. Also refactor visitor queue deadline handling by moving to a strongly typed time point. This removes some manual unit scaling arithmetic that did not appear to be entirely correct in the first place.
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/vespa/storageapi/messageapi/storagecommand.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/storageapi/src/vespa/storageapi/messageapi/storagecommand.h b/storageapi/src/vespa/storageapi/messageapi/storagecommand.h
index b4157c7860a..30d59e5fe4b 100644
--- a/storageapi/src/vespa/storageapi/messageapi/storagecommand.h
+++ b/storageapi/src/vespa/storageapi/messageapi/storagecommand.h
@@ -36,9 +36,7 @@ public:
void setSourceIndex(uint16_t sourceIndex) { _sourceIndex = sourceIndex; }
uint16_t getSourceIndex() const { return _sourceIndex; }
- /** Set timeout in milliseconds. */
- void setTimeout(duration milliseconds) { _timeout = milliseconds; }
- /** Get timeout in milliseconds. */
+ void setTimeout(duration timeout) { _timeout = timeout; }
duration getTimeout() const { return _timeout; }
/** Used to set a new id so the message can be resent. */