[SERVER-77153] Possible division by zero in execution control throughput calculation Created: 15/May/23  Updated: 29/Oct/23  Resolved: 17/May/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc2

Type: Bug Priority: Major - P3
Reporter: Gregory Noma Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0
Sprint: Execution Team 2023-05-29
Participants:
Linked BF Score: 135

 Description   

When calculating throughput for throughput probing, we simply divide the number of operations completed by the time elapsed. While we would expect the time elapsed to never be zero here, we don't protect against it in case the Timer interface does return zero for one reason or another. Thus we would end up dividing by zero, resulting in a throughput of either Infinity or NaN depending on the dividend.



 Comments   
Comment by Githook User [ 17/May/23 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-77153 Protect against zero elapsed time in throughput probing

(cherry picked from commit b46ba042fdce866cb42bca247febecde398fd1c4)
Branch: v7.0
https://github.com/mongodb/mongo/commit/a08bca73b8f75e02b12179cab18d9b9514330f8d

Comment by Githook User [ 17/May/23 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-77153 Protect against zero elapsed time in throughput probing
Branch: master
https://github.com/mongodb/mongo/commit/b46ba042fdce866cb42bca247febecde398fd1c4

Generated at Thu Feb 08 06:34:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.