Skip to content

fix: write to executor stats map while holding mutex #7731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 1, 2023

Conversation

spikecurtis
Copy link
Contributor

fixes #7710

Signed-off-by: Spike Curtis <spike@coder.com>
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

@spikecurtis
Copy link
Contributor Author

Nice find!

🌮 @mtojek for the report

@spikecurtis spikecurtis enabled auto-merge (squash) May 31, 2023 11:35
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure if this is related:

=== Failed
=== FAIL: coderd/database TestPubsub_Disconnect (12.09s)
    pubsub_test.go:125: 
        	Error Trace:	/home/runner/work/coder/coder/coderd/database/pubsub_test.go:125
        	Error:      	Received unexpected error:
        	            	could not start resource:
        	            	    github.com/coder/coder/coderd/database/postgres.OpenContainerized
        	            	        /home/runner/work/coder/coder/coderd/database/postgres/postgres.go:118
        	            	  - API error (500): driver failed programming external connectivity on endpoint eager_bouman (bf988aa79d77ab9d95e89f294334975a89e9b70d955c9f8d8d6e96294644d893): Error starting userland proxy: listen tcp4 0.0.0.0:36475: bind: address already in use
        	            	    
        	            	    github.com/ory/dockertest/v3.(*Pool).RunWithOptions
        	            	    	/home/runner/go/pkg/mod/github.com/ory/dockertest/v3@v3.9.1/dockertest.go:457
        	            	    github.com/coder/coder/coderd/database/postgres.OpenContainerized
        	            	    	/home/runner/work/coder/coder/coderd/database/postgres/postgres.go:82
        	            	    github.com/coder/coder/coderd/database_test.TestPubsub_Disconnect
        	            	    	/home/runner/work/coder/coder/coderd/database/pubsub_test.go:124
        	            	    testing.tRunner
        	            	    	/opt/hostedtoolcache/go/1.20.3/x64/src/testing/testing.go:1576
        	            	    runtime.goexit
        	            	    	/opt/hostedtoolcache/go/1.20.3/x64/src/runtime/asm_amd64.s:1598
        	Test:       	TestPubsub_Disconnect

@spikecurtis
Copy link
Contributor Author

I'm not quite sure if this is related:

=== Failed
=== FAIL: coderd/database TestPubsub_Disconnect (12.09s)
    pubsub_test.go:125: 
        	Error Trace:	/home/runner/work/coder/coder/coderd/database/pubsub_test.go:125
        	Error:      	Received unexpected error:
        	            	could not start resource:
        	            	    github.com/coder/coder/coderd/database/postgres.OpenContainerized
        	            	        /home/runner/work/coder/coder/coderd/database/postgres/postgres.go:118
        	            	  - API error (500): driver failed programming external connectivity on endpoint eager_bouman (bf988aa79d77ab9d95e89f294334975a89e9b70d955c9f8d8d6e96294644d893): Error starting userland proxy: listen tcp4 0.0.0.0:36475: bind: address already in use
        	            	    
        	            	    github.com/ory/dockertest/v3.(*Pool).RunWithOptions
        	            	    	/home/runner/go/pkg/mod/github.com/ory/dockertest/v3@v3.9.1/dockertest.go:457
        	            	    github.com/coder/coder/coderd/database/postgres.OpenContainerized
        	            	    	/home/runner/work/coder/coder/coderd/database/postgres/postgres.go:82
        	            	    github.com/coder/coder/coderd/database_test.TestPubsub_Disconnect
        	            	    	/home/runner/work/coder/coder/coderd/database/pubsub_test.go:124
        	            	    testing.tRunner
        	            	    	/opt/hostedtoolcache/go/1.20.3/x64/src/testing/testing.go:1576
        	            	    runtime.goexit
        	            	    	/opt/hostedtoolcache/go/1.20.3/x64/src/runtime/asm_amd64.s:1598
        	Test:       	TestPubsub_Disconnect

Unrelated to this PR. Test was added in #7660

@spikecurtis spikecurtis changed the title fix: concurrent writes to executor stats fix: serialize writes to executor stats map Jun 1, 2023
@spikecurtis spikecurtis changed the title fix: serialize writes to executor stats map fix: write to executor stats map while holding mutex Jun 1, 2023
@spikecurtis spikecurtis merged commit a46e8f2 into main Jun 1, 2023
@spikecurtis spikecurtis deleted the spike/7710-executor-concurrent-map-write branch June 1, 2023 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autobuild: fatal error: concurrent map writes
3 participants