<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:36:17 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>[GODRIVER-1382] fatal error: concurrent map writes</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1382</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Hi guys,&lt;/p&gt;


&lt;p&gt;I get the follow fatal error when running some code inside goroutines and it looks like the BSON package has an issue:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;2019-10-31 14:07:07 fatal error: concurrent map writes&lt;br/&gt;
2019-10-31 14:07:07&lt;br/&gt;
2019-10-31 14:07:07 goroutine 8075 &lt;span class=&quot;error&quot;&gt;&amp;#91;running&amp;#93;&lt;/span&gt;:&lt;br/&gt;
2019-10-31 14:07:07 runtime.throw(0x133c910, 0x15)&lt;br/&gt;
2019-10-31 14:07:07 /usr/local/go/src/runtime/panic.go:608 +0x72 fp=0xc003623008 sp=0xc003622fd8 pc=0x42c792&lt;br/&gt;
2019-10-31 14:07:07 runtime.mapassign(0x111d7a0, 0xc000dbeb70, 0xc003376cd0, 0xc003376cd0)&lt;br/&gt;
2019-10-31 14:07:07 /usr/local/go/src/runtime/map.go:563 +0x560 fp=0xc003623090 sp=0xc003623008 pc=0x40fa10&lt;br/&gt;
2019-10-31 14:07:07 reflect.mapassign(0x111d7a0, 0xc000dbeb70, 0xc003376cd0, 0xc004056420)&lt;br/&gt;
2019-10-31 14:07:07 /usr/local/go/src/runtime/map.go:1259 +0x3f fp=0xc0036230c0 sp=0xc003623090 pc=0x4112bf&lt;br/&gt;
2019-10-31 14:07:07 reflect.Value.SetMapIndex(0x111d7a0, 0xc0008f34c8, 0x195, 0x10c3580, 0xc003376cd0, 0x98, 0x12dbae0, 0xc004056420, 0x199)&lt;br/&gt;
2019-10-31 14:07:07 /usr/local/go/src/reflect/value.go:1545 +0x22f fp=0xc003623128 sp=0xc0036230c0 pc=0x4b776f&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec.DefaultValueDecoders.MapDecodeValue(0xc000483ab0, 0x21d1600, 0x0, 0x0, 0x1748ca0, 0xc0016c5300, 0x111d7a0, 0xc0008f34c8, 0x195, 0x0, ...)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go:699 +0x427 fp=0xc0036232c0 sp=0xc003623128 pc=0xbc5cc7&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec.DefaultValueDecoders.MapDecodeValue-fm(0xc000483ab0, 0x0, 0x0, 0x0, 0x1748ca0, 0xc0016c5300, 0x111d7a0, 0xc0008f34c8, 0x195, 0x111d7a0, ...)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go:79 +0x96 fp=0xc003623328 sp=0xc0036232c0 pc=0xbdcdb6&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec.ValueDecoderFunc.DecodeValue(0xc000469830, 0xc000483ab0, 0x0, 0x0, 0x0, 0x1748ca0, 0xc0016c5300, 0x111d7a0, 0xc0008f34c8, 0x195, ...)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go:156 +0x98 fp=0xc003623390 sp=0xc003623328 pc=0xbbd2d8&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).DecodeValue(0xc0003ff3e0, 0xc000483ab0, 0x1303600, 0x0, 0x0, 0x1748ca0, 0xc0016c5300, 0x1303640, 0xc0008f3400, 0x199, ...)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go:212 +0x5c3 fp=0xc0036236b8 sp=0xc003623390 pc=0xbd72d3&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson.(*Decoder).Decode(0xc0017865a0, 0x112a5a0, 0xc0008f3400, 0x11a0fc0, 0xc0017865a0)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/decoder.go:92 +0x231 fp=0xc003623788 sp=0xc0036236b8 pc=0xbe3391&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson.unmarshalFromReader(0xc000483ab0, 0xc0016c5300, 0x0, 0x0, 0x1748ca0, 0xc0016c5300, 0x112a5a0, 0xc0008f3400, 0x0, 0x0)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go:100 +0xfd fp=0xc0036237c8 sp=0xc003623788 pc=0xbe8fad&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson.UnmarshalWithRegistry(0xc000483ab0, 0xc0010b2acf, 0x8be, 0x948, 0x112a5a0, 0xc0008f3400, 0x1, 0xc001c3b2c0)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go:45 +0x12d fp=0xc003623840 sp=0xc0036237c8 pc=0xbe8e3d&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/vendor/go.mongodb.org/mongo-driver/mongo.(*SingleResult).Decode(0xc0016c5240, 0x112a5a0, 0xc0008f3400, 0x114eb80, 0xc0034e4c00)&lt;br/&gt;
2019-10-31 14:07:07 /tmp/staging652131288/srv/gopath/src/github.com/.../api/vendor/go.mongodb.org/mongo-driver/mongo/single_result.go:46 +0xbe fp=0xc003623890 sp=0xc003623840 pc=0xd193fe&lt;br/&gt;
2019-10-31 14:07:07 github.com/.../api/services/segmentation.(*Service).RecomputeOneSegmentForUser(0xc001f236b0, 0x173edc0, 0xc0034e4ae0, 0xc0002b16b0, 0xc0008f3400, 0xc0005e52c0, 0xc003efca80, 0xc0017fd300, 0xbf66d882f3ed8f04, 0x952a922ad, ...)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Any idea please?&lt;br/&gt;
Thanks&lt;/p&gt;</description>
                <environment>Google App Engine Go 1.11</environment>
        <key id="986180">GODRIVER-1382</key>
            <summary>fatal error: concurrent map writes</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="13202">Works as Designed</resolution>
                                        <assignee username="divjot.arora@mongodb.com">Divjot Arora</assignee>
                                    <reporter username="pierre@captainmetrics.com">Pierre Bazoge</reporter>
                        <labels>
                    </labels>
                <created>Thu, 31 Oct 2019 14:27:27 +0000</created>
                <updated>Fri, 27 Oct 2023 13:16:30 +0000</updated>
                            <resolved>Thu, 31 Oct 2019 19:58:15 +0000</resolved>
                                    <version>1.1.2</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="2513720" author="pierre@captainmetrics.com" created="Fri, 1 Nov 2019 10:18:36 +0000"  >&lt;p&gt;Alright, thank you for your support!&lt;/p&gt;</comment>
                            <comment id="2513205" author="divjot.arora" created="Thu, 31 Oct 2019 19:58:15 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pierre%40captainmetrics.com&quot; class=&quot;user-hover&quot; rel=&quot;pierre@captainmetrics.com&quot;&gt;pierre@captainmetrics.com&lt;/a&gt;,&#160;&lt;/p&gt;

&lt;p&gt;Thank you for your bug report. Go does not allow concurrent writes to maps and therefore decoding into the same pointer is not a supported use case. I&apos;ve verified that a similar issue occurs with the &lt;tt&gt;encoding/json&lt;/tt&gt; library. I&apos;m going to close this ticket as &quot;Works as Designed&quot; but feel free to re-open or open a new ticket if you have any other questions.&lt;/p&gt;

&lt;p&gt;&amp;#8211; Divjot&lt;/p&gt;</comment>
                            <comment id="2513083" author="pierre@captainmetrics.com" created="Thu, 31 Oct 2019 18:56:42 +0000"  >&lt;p&gt;The problem comes when multiple DB queries, each one in a go routine, .Decode() into the same pointer.&lt;/p&gt;

&lt;p&gt;Is this error by design, or it&apos;s a miss from the BSON implementation?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvocnz:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>