[CDRIVER-748] Test with ThreadSanitizer Created: 15/Jul/15  Updated: 30/Jul/20  Resolved: 02/Jul/20

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.17.0-rc0, 1.17.0

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Kevin Albertson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-1055 Unit Tests Under -fsanitize=address T... Closed
Epic Link: CDRIVER-2733

 Description   

Test with TSAN in continuous integration. The driver should not ship with thread sanitizer warnings.



 Comments   
Comment by Githook User [ 11/Jul/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 add TSAN tasks
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/e1ffa0942b7998ac9f9b106554a283002a35341a

Comment by Githook User [ 11/Jul/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 fix TSAN for topology tests
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/f9b21490de397361398ac0df006ec1bc991832d0

Comment by Githook User [ 11/Jul/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 fix mock server for TSAN

mock_server_hangs_up and mock_server_resets were closing a
request stream directly from the main thread. But a request
stream should only be accessed by the worker thread. This
now adds a special reply to the worker thread's queue
to signal a hangup or reset.
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/867e24cba113584723c6ac28c5adccfea7a56931

Comment by Githook User [ 02/Jul/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 add TSAN tasks
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/dcc051d0a076719f3e84a8c525f79985a4f2be57

Comment by Githook User [ 02/Jul/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 fix TSAN for topology tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7c950d7a38df375300d6488a24143f5f2a52bf72

Comment by Githook User [ 02/Jul/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 fix mock server for TSAN

mock_server_hangs_up and mock_server_resets were closing a
request stream directly from the main thread. But a request
stream should only be accessed by the worker thread. This
now adds a special reply to the worker thread's queue
to signal a hangup or reset.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/558f2f4e2d7c4d0a8d300f3f7740b755263f533b

Comment by Kevin Albertson [ 01/Jul/20 ]

PR: https://github.com/mongodb/mongo-c-driver/pull/653

Comment by Kevin Albertson [ 04/Jun/20 ]

PR: https://github.com/mongodb/mongo-c-driver/pull/620

Comment by Githook User [ 29/May/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 fix mock server for TSAN (#620)

mock_server_hangs_up and mock_server_resets were closing a
request stream directly from the main thread. But a request
stream should only be accessed by the worker thread. This
now adds a special reply to the worker thread's queue
to signal a hangup or reset.
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/02fd694b01313ea33a028c730ca16fac22ac2725

Comment by Githook User [ 29/May/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-748 fix mock server for TSAN (#620)

mock_server_hangs_up and mock_server_resets were closing a
request stream directly from the main thread. But a request
stream should only be accessed by the worker thread. This
now adds a special reply to the worker thread's queue
to signal a hangup or reset.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/a562d82c9692cb0392df1b7460390d6d3f288a65

Comment by Kevin Albertson [ 14/Dec/18 ]

We should validate that we don't concurrently access mongoc_topology_scanner_node_t in the scanner thread and outside. Some things seem suspicious, e.g. _mongoc_topology_update_last_used

Comment by Githook User [ 31/Aug/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-748 thread-sanitize the mock server

It had been reading client requests on a worker thread, then passing the
client stream to the main thread to right the server reply. Don't share
the stream object between threads: enqueue the main thread's reply and
actually send it on the worker thread.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/8fd25223acba9e63fe81c1d4712890cad96163b8

Comment by Githook User [ 31/Aug/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-748 thread-sanitize the topology tests

Valgrind's DRD rightly warns that future_topology_select and the main
thread have conflicting loads of "scanner->async->ncmds".
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/63ce66dd5df8cd91ee31f27268a129cfbdbfec5d

Generated at Wed Feb 07 21:10:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.