[SERVER-28416] Handle GDB error in hang_analyzer.py mongodb-uniqstack module Created: 21/Mar/17  Updated: 06/Dec/17  Resolved: 30/Mar/17

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.4.5, 3.5.6

Type: Task Priority: Major - P3
Reporter: Jonathan Abrahams Assignee: Jonathan Abrahams
Resolution: Done Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4
Sprint: TIG 2017-03-27, TIG 2017-04-17
Participants:
Linked BF Score: 0

 Description   

The mongodb-uniqstack module goes through each thread and frame to detect unique or duplicate threads in a process. On the s390x platform it can error, which terminates the module, producing no backtrace output. Partial output is preferable to none, so the GDB error should be trapped and not raised.

            try:
                thread_info['frames'] = gdb.execute(arg, to_string=True).rstrip()
            except gdb.error as err:
                raise gdb.GdbError("{} {}".format(thread_info['header'], err))



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

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Hang analyzer GDB on ARM can run "thread apply all bt"

(cherry picked from commit 7677a8aa544a5df51c2bd45f6859cd3b97459108)
Branch: v3.4
https://github.com/mongodb/mongo/commit/13e346ae91c38f9e378d03de855859b1e3548db5

Comment by Githook User [ 02/May/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Split mongo pretty printers into separate file

(cherry picked from commit d6552eddacb8afd90bebf55d3cd98cb77f543655)
Branch: v3.4
https://github.com/mongodb/mongo/commit/933c560188eeac4b9d5658f8ebc05310a3f972a0

Comment by Githook User [ 02/May/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Fix BSONObj pretty printer used in hang_analyzer to support big and little endianness

(cherry picked from commit 3412b99e9f81199a7265fd0483d9b01432dbe53b)
Branch: v3.4
https://github.com/mongodb/mongo/commit/87dc6cc5870b8c098526b5bca02930c2c5b5ab86

Comment by Githook User [ 02/May/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Continue on error in mongodb-uniqstack in hang_analyzer

(cherry picked from commit e9e806ee1f03b8328bb689ac0ce66625d16a59ee)
Branch: v3.4
https://github.com/mongodb/mongo/commit/03847eeb91b2bb2146af1bcd7efb21be026ee404

Comment by Githook User [ 30/Mar/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Hang analyzer GDB on ARM can run "thread apply all bt"
Branch: master
https://github.com/mongodb/mongo/commit/7677a8aa544a5df51c2bd45f6859cd3b97459108

Comment by Githook User [ 30/Mar/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Split mongo pretty printers into separate file
Branch: master
https://github.com/mongodb/mongo/commit/d6552eddacb8afd90bebf55d3cd98cb77f543655

Comment by Githook User [ 29/Mar/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Fix BSONObj pretty printer used in hang_analyzer to support big and little endianness
Branch: master
https://github.com/mongodb/mongo/commit/3412b99e9f81199a7265fd0483d9b01432dbe53b

Comment by Githook User [ 29/Mar/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28416 Continue on error in mongodb-uniqstack in hang_analyzer
Branch: master
https://github.com/mongodb/mongo/commit/e9e806ee1f03b8328bb689ac0ce66625d16a59ee

Comment by Jonathan Abrahams [ 27/Mar/17 ]

The pretty_printer modules causes a hang in bt. We will restructure the logic to split out the pretty_printers from mongo.py and not load them on this platform.

Comment by Max Hirschhorn [ 27/Mar/17 ]

For now, we will execute a bt on all threads, through the Python/GDB module before loading the mongo python modules.

jonathan.abrahams, is this not already covered by writing the output of thread apply all bt to an xx_raw_stacks.log file that was done as part of the changes in SERVER-27727?

Comment by Jonathan Abrahams [ 27/Mar/17 ]

Handling the GDB error will not solve the underlying problem that the bt will hang after the python modules has been loaded.

For now, we will execute a bt on all threads, through the Python/GDB module before loading the mongo python modules.

Comment by Jonathan Abrahams [ 27/Mar/17 ]

Handling the GDB error will not solve the underlying problem that the bt will hang after the python modules have been loaded. An alternate would be to have the mongodb-uniqstack module write it's own backtrace instead of relying on a call to gdb.execute.

Generated at Thu Feb 08 04:18:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.