Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3710

Log monitoring errors with warning/error levels instead of debug

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Testing
    • Labels:
      None

      Network and command errors encountered in multi-threaded monitoring are logged as debug errors (with level MONGOC_LOG_LEVEL_DEBUG). They should be logged as MONGOC_LOG_LEVEL_ERROR and MONGOC_LOG_LEVEL_WARNING.

      They were left as debug logs in CDRIVER-3535. This was because error/warning logs are printed to stderr. The test script compile-unix.sh asserts that tests nothing is printed to stderr. But many tests simulate monitoring errors with the mock server. See this conversation in the PR for more context. https://github.com/mongodb/mongo-c-driver/pull/625/files/65977607f7e1d500dfa4123711452c435ab08d3c#r435400372

      We may need to add calls to capture_logs() in all tests where we expect monitoring errors to occur, so they do not get printed to stderr.

      Also consider:

      1. Errors encountered in single-threaded monitoring are not logged. If these are generally useful, it follows we should add similar logs for single-threaded monitoring in mongoc-async.c.
      2. have test-libmongoc make assertions that unexpected error logs are not encountered. This way, it will be easier to test these assertions locally, and on any platform.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: