<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:17:00 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-48396] SIGUSR2 stack collection closes connections</title>
                <link>https://jira.mongodb.org/browse/SERVER-48396</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I ran the repro script in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48395&quot; title=&quot;Extended stalls during heavy insert workload&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48395&quot;&gt;&lt;del&gt;SERVER-48395&lt;/del&gt;&lt;/a&gt; while sending mongod a SIGUSR2 every 10 seconds to collect stack traces. This resulted in network errors and failed operations at the application&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Error: error doing query: failed: network error while attempting to run command &apos;insert&apos; on host &apos;127.0.0.1:27017&apos;  :&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;accompanied by messages from the mongo shell like&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{&quot;t&quot;:{&quot;$date&quot;:&quot;2020-05-25T15:07:29.723Z&quot;},&quot;s&quot;:&quot;I&quot;,  &quot;c&quot;:&quot;NETWORK&quot;,  &quot;id&quot;:20120,   &quot;ctx&quot;:&quot;js&quot;,&quot;msg&quot;:&quot;Trying to reconnnect&quot;,&quot;attr&quot;:{&quot;connString&quot;:&quot;127.0.0.1:27017 failed&quot;}}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{&quot;t&quot;:{&quot;$date&quot;:&quot;2020-05-25T15:07:29.724Z&quot;},&quot;s&quot;:&quot;I&quot;,  &quot;c&quot;:&quot;NETWORK&quot;,  &quot;id&quot;:20125,   &quot;ctx&quot;:&quot;js&quot;,&quot;msg&quot;:&quot;DBClientConnection failed to receive message&quot;,&quot;attr&quot;:{&quot;connString&quot;:&quot;127.0.0.1:27017&quot;,&quot;error&quot;:&quot;HostUnreachable: Connection closed by peer&quot;}}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;The mongod logs tell a similar story:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/262372/262372_sigusr2.png&quot; width=&quot;100%&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The blue markers on the timeline show the points at which SIGUSR2 was received. These are accompanied by some number of connections ended (red curve) and a smaller number of connections accepted (blue curve), resulting in a net decrease of connections each time (green curve)&lt;/p&gt;

&lt;p&gt;I wonder if we might not be re-trying network operations when they return the EINTR that would result from SIGUSR2.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1361806">SERVER-48396</key>
            <summary>SIGUSR2 stack collection closes connections</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="billy.donahue@mongodb.com">Billy Donahue</assignee>
                                    <reporter username="bruce.lucas@mongodb.com">Bruce Lucas</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 May 2020 15:54:24 +0000</created>
                <updated>Sun, 29 Oct 2023 22:07:49 +0000</updated>
                            <resolved>Sat, 30 May 2020 18:05:58 +0000</resolved>
                                    <version>4.4.0-rc6</version>
                                    <fixVersion>4.4.0-rc11</fixVersion>
                    <fixVersion>4.7.0</fixVersion>
                                    <component>Diagnostics</component>
                    <component>Networking</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="3218644" author="xgen-internal-githook" created="Mon, 22 Jun 2020 23:14:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Billy Donahue&apos;, &apos;email&apos;: &apos;billy.donahue@mongodb.com&apos;, &apos;username&apos;: &apos;BillyDonahue&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48396&quot; title=&quot;SIGUSR2 stack collection closes connections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48396&quot;&gt;&lt;del&gt;SERVER-48396&lt;/del&gt;&lt;/a&gt; stop SIGUSR2 from killing connections&lt;/p&gt;

&lt;p&gt;    Add SA_RESTART to stacktrace_thread handler&lt;/p&gt;

&lt;p&gt;    This is a partial cherry-pick, we DO NOT modify&lt;br/&gt;
    asio::read or asio::write calls as the&lt;br/&gt;
    original did&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 8ea7299541bdb315926d7fe17373c0387645fae6)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/be486f8f49efcc706a53a072cb5527e1200a49cf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/be486f8f49efcc706a53a072cb5527e1200a49cf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3161932" author="billy.donahue" created="Mon, 1 Jun 2020 23:18:37 +0000"  >&lt;blockquote&gt;&lt;p&gt;It isn&apos;t about a single call to&#160;&lt;tt&gt;asio::read()&lt;/tt&gt;&#160;but the space in between the calls. Imagine you experience an interruption and return&#160;&lt;tt&gt;asio::error::interrupted&lt;/tt&gt;&#160;on the networking thread but go no further. Then another thread attempts to call&#160;&lt;tt&gt;asio::basic_stream_socket::cancel()&lt;/tt&gt;. Since you haven&apos;t called&#160;&lt;tt&gt;asio::read()&lt;/tt&gt;&#160;again yet, and there isn&apos;t any enforcement of sequence, there is nothing to cancel so we just go back into blocking until another event happens. It can be a long long time until that next event.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&#160;&lt;br/&gt;
 Who&apos;s the &quot;we&quot; that goes back into blocking? I&apos;m thinking the thread that returned &lt;tt&gt;interrupted&lt;/tt&gt; is going to immediately do-loop back into &lt;tt&gt;asio::read&lt;/tt&gt;, at which point asio would see that the &quot;cancellation token&quot; for the read operation has expired, so the read would return immediately without blocking at all, but this time return the &lt;tt&gt;operation_aborted&lt;/tt&gt; code. I mean I haven&apos;t looked at the Asio source for this but I would hope that&apos;s how it works. Maybe something about expiring the cancellation token doesn&apos;t propagate to the read operation in time to stop it from blocking? When you say &quot;there isn&apos;t any enforcement of sequence&quot; I have to wonder whether Asio cancellation works at all if that&apos;s the case. Is this an Asio synchronization bug or what?&#160;What do you mean about lack of sequencing exactly? Interesting issue.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;update&lt;/b&gt; Oh maybe I get it. Maybe there IS no &lt;tt&gt;asio::read&lt;/tt&gt;&#160;operation to cancel anymore. As a caller, you had your chance. The &lt;tt&gt;asio::read&lt;/tt&gt;&#160;operation you canceled is over, and it returned &lt;tt&gt;interrupted&lt;/tt&gt;. If you want to call &lt;tt&gt;asio::read&lt;/tt&gt;&#160;again (as a retry of the &lt;tt&gt;interrupted&lt;/tt&gt; call, that&apos;s on you, and you&apos;ll have to cancel the new one if you want to cancel something. Maybe that&apos;s the problem.&lt;/p&gt;</comment>
                            <comment id="3151536" author="ben.caimano" created="Mon, 1 Jun 2020 18:28:32 +0000"  >&lt;p&gt;It isn&apos;t about a single call to &lt;tt&gt;asio::read()&lt;/tt&gt; but the space in between the calls. Imagine you experience an interruption and return &lt;tt&gt;asio::error::interrupted&lt;/tt&gt;&#160;on the networking thread but go no further. Then another thread attempts to call &lt;tt&gt;asio::basic_stream_socket::cancel()&lt;/tt&gt;. Since you haven&apos;t called &lt;tt&gt;asio::read()&lt;/tt&gt; again yet, and there isn&apos;t any enforcement of sequence, there is nothing to cancel so we just go back into blocking until another event happens. It can be a long long time until that next event.&lt;/p&gt;</comment>
                            <comment id="3150007" author="billy.donahue" created="Mon, 1 Jun 2020 16:00:17 +0000"  >&lt;p&gt;Can you explain the problem you&apos;re anticipating? I wrote this fix thinking that cancellation was accounted for in asio&apos;s low-level recv/send loops, so the async asio::read/write would return &lt;tt&gt;boost::asio::error::operation_aborted&lt;/tt&gt;&#160;instead of &lt;tt&gt;boost::asio::error::interrupted&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="3148411" author="ben.caimano" created="Mon, 1 Jun 2020 13:12:19 +0000"  >&lt;p&gt;I believe this adds an extra opportunity to miss asio cancelation. We already had this problem from batons, so I&apos;ll make sure I fix this spot as well.&lt;/p&gt;</comment>
                            <comment id="3147124" author="xgen-internal-githook" created="Fri, 29 May 2020 21:20:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Billy Donahue&apos;, &apos;email&apos;: &apos;billy.donahue@mongodb.com&apos;, &apos;username&apos;: &apos;BillyDonahue&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48396&quot; title=&quot;SIGUSR2 stack collection closes connections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48396&quot;&gt;&lt;del&gt;SERVER-48396&lt;/del&gt;&lt;/a&gt; stop SIGUSR2 from killing connections&lt;/p&gt;

&lt;p&gt;    Add SA_RESTART to stacktrace_thread handler&lt;br/&gt;
    Restart asio::read and asio::write on EINTR&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/8ea7299541bdb315926d7fe17373c0387645fae6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/8ea7299541bdb315926d7fe17373c0387645fae6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3117058" author="billy.donahue" created="Tue, 26 May 2020 23:07:24 +0000"  >&lt;p&gt;CR &lt;a href=&quot;http://mongodbcr.appspot.com/614080001&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongodbcr.appspot.com/614080001&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3111667" author="billy.donahue" created="Tue, 26 May 2020 21:16:18 +0000"  >&lt;p&gt;These connection threads are all dying from syscall &lt;tt&gt;recvmsg&lt;/tt&gt; returning an &lt;tt&gt;EINTR&lt;/tt&gt;. We can see that in the attached log.&lt;/p&gt;

&lt;p&gt;Now, according to the man page &lt;tt&gt;signal(7)&lt;/tt&gt;, whether the &lt;tt&gt;SA_RESTART&lt;/tt&gt; flag will help or not depends on whether the sockets doing these &lt;tt&gt;recvmsg&lt;/tt&gt; calls have a timeout. If the socket has a receive timeout then SA_RESTART, doesn&apos;t matter, and they&apos;ll still get the &lt;tt&gt;EINTR&lt;/tt&gt;. We might look into the code and prove to ourselves that SA_RESTART will help because perhaps they all DO have a timeout set, but that&apos;s not a durable fix. We might need to get into our Asio calls and actually deal with the EINTR in an upfront way.&lt;/p&gt;

&lt;p&gt;From man signal(7):&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;If a blocked call to one of the following interfaces is interrupted by a signal handler, then the call is automatically restarted after the signal handler returns if the SA_RESTART flag was used; otherwise the call fails with the error EINTR:&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;...&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;       * Socket interfaces: accept(2), connect(2), recv(2), recvfrom(2), recvmmsg(2), recvmsg(2), send(2), sendto(2), and sendmsg(2), unless a timeout has been set on the socket (see below).&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;But then...&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;The following interfaces are never restarted after being interrupted by a signal handler, regardless of the use of SA_RESTART; they always fail with the error EINTR when interrupted by a signal handler:&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;...&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;       * &quot;Input&quot; socket interfaces, when a timeout (SO_RCVTIMEO) has been set on the socket using setsockopt(2): accept(2), recv(2), recvfrom(2), recvmmsg(2) (also with a non-NULL timeout argument), and recvmsg(2).&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;


&lt;p&gt;So I&apos;m going to look into src/mongo/transport/session_asio.h and see if I can add some EINTR resilience.&lt;/p&gt;

&lt;p&gt;I see a socket_ops::send also in the stacktrace. Writes might need the same treatment.&lt;/p&gt;

&lt;p&gt;If they aren&apos;t fixed, these calls will also fail if the process is stopped by anything, like a ^Z or a debugger.&lt;/p&gt;</comment>
                            <comment id="3107640" author="billy.donahue" created="Tue, 26 May 2020 18:46:42 +0000"  >&lt;p&gt;Bruce the SA_RESTART idea sounds right.&lt;/p&gt;

&lt;p&gt;EVERY thread in the process will get a SIGUSR2 during multithread stacktrace collection.&lt;/p&gt;

&lt;p&gt;It is a little troubling to me that the EINTR caused by our SIGUSR2 isn&apos;t handled gracefully though. But this SIGUSR2 isn&apos;t intended to cancel or interrupt any syscalls, and it&apos;s purely passive instrumentation, so the SA_RESTART is appropriate here.&lt;/p&gt;</comment>
                            <comment id="3106529" author="bruce.lucas@10gen.com" created="Tue, 26 May 2020 11:06:34 +0000"  >&lt;p&gt;I wonder if adding SA_RESTART to sa_flags in the sigaction call that establishes the SIGUSR2 handler would address this.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1361790">SERVER-48395</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="501103">SERVER-33445</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1300494">SERVER-47229</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="262373" name="db.log" size="1939453" author="bruce.lucas@mongodb.com" created="Mon, 25 May 2020 15:55:43 +0000"/>
                            <attachment id="262372" name="sigusr2.png" size="81103" author="bruce.lucas@mongodb.com" created="Mon, 25 May 2020 15:53:50 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 26 May 2020 18:46:42 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 33 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 33 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>ben.caimano@mongodb.com</customfieldvalue>
            <customfieldvalue>billy.donahue@mongodb.com</customfieldvalue>
            <customfieldvalue>bruce.lucas@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxmwp3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxa4vz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxmiyf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>