Skip to content
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

Concurrent map read and map write under Go 1.6.0 #39

Closed
solher opened this issue Mar 3, 2016 · 10 comments
Closed

Concurrent map read and map write under Go 1.6.0 #39

solher opened this issue Mar 3, 2016 · 10 comments

Comments

@solher
Copy link

solher commented Mar 3, 2016

Since Go 1.6.0 and the concurrent acces detector, my app crashes under heavy load:

fatal error: concurrent map read and map write

at github.com/go-zoo/bone/route.go:98

Does anybody else is experiencing the same issue ?

@haoxins
Copy link
Contributor

haoxins commented Mar 3, 2016

map vars has been deleted In the branch beta https://github.com/go-zoo/bone/tree/beta, 11ebbcb.

@solher
Copy link
Author

solher commented Mar 3, 2016

Ok cool ;)

@squiidz squiidz closed this as completed Mar 3, 2016
@solher
Copy link
Author

solher commented Mar 4, 2016

New error, even in the branch beta.
I got a fatal error: concurrent map writes on the muxStack[req] = m in ServeHTTP.

func (m *Mux) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
    muxStack[req] = m
    // Check if a route match
    if !m.parse(rw, req) {
        // Check if it's a static ressource
        if !m.staticRoute(rw, req) {
            // Check if the request path doesn't end with /
            if !m.validate(rw, req) {
                m.HandleNotFound(rw, req)
            }
        }
    }
    delete(muxStack, req)
}

@squiidz
Copy link
Member

squiidz commented Mar 4, 2016

I'm already working on this :) should be fix tomorrow. I'ts a litlle bit long, because i'm trying to find a way to drop the delay of route containing variables. Any ideas are welcome !

@solher
Copy link
Author

solher commented Mar 4, 2016

Hahaha awesome :)

@squiidz squiidz reopened this Mar 7, 2016
@solher
Copy link
Author

solher commented Mar 8, 2016

It seems that it is still not working.
I still got some fatal error: concurrent map writes at the same place.

Any plans ? Because half of my services crash right now.

@squiidz
Copy link
Member

squiidz commented Mar 8, 2016

It should be done tomorrow, I will notify you when it's ok. Sorry for the delay

@solher
Copy link
Author

solher commented Mar 8, 2016

No problem, thanks 👍

squiidz pushed a commit that referenced this issue Mar 9, 2016
@squiidz
Copy link
Member

squiidz commented Mar 9, 2016

it should work on the beta branch now.

@squiidz squiidz closed this as completed Mar 10, 2016
@solher
Copy link
Author

solher commented Mar 10, 2016

Thanks a lot ;)

This issue was closed.
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

No branches or pull requests

3 participants