Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1613

Command duration reported by APM may exceed 32-bit integer

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      mongoc_apm_command_succeeded_get_duration and mongoc_apm_command_failed_get_duration both return an int64_t, which could exceed the size of getDurationMicros()'s return value if PHP is compiled for 32-bit.

      I don't think it's worth conditionally returning a string or Int64 type, especially since this is just for command monitoring, but perhaps we should just note this in the documentation. We might also consider displaying a warning when the return value is truncated, as is done for wtimeout in PHPC-1411. It would also be helpful to verify that the value is truncated and we need not worry about inadvertently returning a negative value.

      I came across this while working on AppVeyor builds in PHPC-1131 when both monitoring-commandSucceeded-001.phpt and monitoring-commandFailed-001.phpt failed.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: