Skip to content

Add concurrency in content API #25

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

harry-hov
Copy link
Contributor

No description provided.

@harry-hov harry-hov requested a review from faza July 26, 2022 04:54
@harry-hov harry-hov force-pushed the hariom/content-api branch from 7494f80 to 3f1a5e2 Compare July 28, 2022 09:48
@harry-hov harry-hov force-pushed the hariom/content-api branch from 3f1a5e2 to 866338f Compare July 29, 2022 04:29
@harry-hov
Copy link
Contributor Author

Blocker: go-git doesn't support concurrency.

@harry-hov
Copy link
Contributor Author

2022/07/29 12:20:54 request: POST localhost:5050/content
fatal error: concurrent map writes
fatal error: concurrent map writes

goroutine 871 [running]:
runtime.throw({0x10374c497, 0x15})
        /usr/local/go/src/runtime/panic.go:1198 +0x54 fp=0x140005958c0 sp=0x14000595890 pc=0x102d02af4
runtime.mapassign_fast64(0x103aa1920, 0x14000e7e8a0, 0x929be)
        /usr/local/go/src/runtime/map_fast64.go:176 +0x2f4 fp=0x14000595900 sp=0x140005958c0 pc=0x102cdc284
github.com/gitopia/go-git/v5/plumbing/format/idxfile.(*MemoryIndex).FindOffset(0x140010b5600, {0xa5, 0x6, 0xf0, 0x63, 0xfb, 0x6f, 0xe5, 0x6e, 0x8c, ...})
        /Users/harry-hov/go/pkg/mod/github.com/gitopia/go-git/[email protected]/plumbing/format/idxfile/idxfile.go:133 +0xf0 fp=0x14000595950 sp=0x14000595900 pc=0x10304cda0
github.com/gitopia/go-git/v5/storage/filesystem.(*ObjectStorage).findObjectInPackfile(0x140005be0b8, {0xa5, 0x6, 0xf0, 0x63, 0xfb, 0x6f, 0xe5, 0x6e, 0x8c, ...})
        /Users/harry-hov/go/pkg/mod/github.com/gitopia/go-git/[email protected]/storage/filesystem/object.go:531 +0xc8 fp=0x14000595a10 sp=0x14000595950 pc=0x103072f58
github.com/gitopia/go-git/v5/storage/filesystem.(*ObjectStorage).getFromPackfile(0x140005be0b8, {0xa5, 0x6, 0xf0, 0x63, 0xfb, 0x6f, 0xe5, 0x6e, 0x8c, ...}, ...)
        /Users/harry-hov/go/pkg/mod/github.com/gitopia/go-git/[email protected]/storage/filesystem/object.go:447 +0x88 fp=0x14000595b00 sp=0x14000595a10 pc=0x103072718
github.com/gitopia/go-git/v5/storage/filesystem.(*ObjectStorage).EncodedObject(0x140005be0b8, 0x1, {0xa5, 0x6, 0xf0, 0x63, 0xfb, 0x6f, 0xe5, 0x6e, ...})
        /Users/harry-hov/go/pkg/mod/github.com/gitopia/go-git/[email protected]/storage/filesystem/object.go:317 +0x4c fp=0x14000595bb0 sp=0x14000595b00 pc=0x103071b0c
github.com/gitopia/go-git/v5/plumbing/object.GetCommit({0x12bc4d378, 0x140005be0a0}, {0xa5, 0x6, 0xf0, 0x63, 0xfb, 0x6f, 0xe5, 0x6e, ...})
        /Users/harry-hov/go/pkg/mod/github.com/gitopia/go-git/[email protected]/plumbing/object/commit.go:55 +0x50 fp=0x14000595c00 sp=0x14000595bb0 pc=0x103025520
github.com/gitopia/git-server/utils.GetLastCommit.func1(0x14001431200, 0x14001430d80, 0x14001430d20, {0x1400110a330, 0xf}, {0x14000f1ab40, 0x28}, 0x140004f88a0, {0x103c46070, 0x140005be0a0})
        /Users/harry-hov/Desktop/work/git-server/utils/content.go:223 +0x1d4 fp=0x14000595f80 sp=0x14000595c00 pc=0x103719c34
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1133 +0x4 fp=0x14000595f80 sp=0x14000595f80 pc=0x102d36094
created by github.com/gitopia/git-server/utils.GetLastCommit
        /Users/harry-hov/Desktop/work/git-server/utils/content.go:210 +0x98

@harry-hov
Copy link
Contributor Author

Possible solutions:

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.

1 participant