-
Notifications
You must be signed in to change notification settings - Fork 109
Conversation
@@ -75,7 +89,7 @@ jobs: | |||
- make TEST=ruby integration | |||
|
|||
- language: java | |||
jdk: oraclejdk9 | |||
jdk: openjdk10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fix a build
go.mod
Outdated
@@ -8,13 +8,15 @@ require ( | |||
github.com/boltdb/bolt v1.3.1 | |||
github.com/cespare/xxhash v1.1.0 // indirect | |||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect | |||
github.com/flier/gohs v1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binding for hyperscan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we update this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"go mod tidy"
go.mod
Outdated
github.com/go-ole/go-ole v1.2.2 // indirect | ||
github.com/go-sql-driver/mysql v1.4.1 | ||
github.com/gogo/protobuf v1.2.0 // indirect | ||
github.com/google/go-cmp v0.2.0 // indirect | ||
github.com/gorilla/handlers v1.4.0 // indirect | ||
github.com/gorilla/mux v1.7.0 // indirect | ||
github.com/hashicorp/memberlist v0.1.3 // indirect | ||
github.com/linyows/go-onigmo v0.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binding for onigmo
|
||
if n == "hyperscan" { | ||
return "hyperscan" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these lines can be transformed into:
switch n {
case "onigmo", "oniguruma", "hyperscan":
return n
}
internal/regex/regex_onigmo.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
runtime.SetFinalizer(re, (*onigmo.Regexp).Free) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finalizers are not guaranteed to be called. I don't think it's a proper mechanism to free the regexps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safest refactoring (IMO) is to extend our matcher interface by adding close/free function. Or maybe we can sacrifice some performance and have only one Match function which will be registered and do all - compile/match/free.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can check in the usage place if the matcher implements io.Closer
and then implement Close() error
method only in the matchers that need some closing.
That way, current matchers do not need any refactoring and nothing needs to change. Then, in the place we use the matcher we add the io.Closer
spec and call it if needed.
internal/regex/regex_hyperscan.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
runtime.SetFinalizer(db, (hyperscan.Database).Close) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with this
.travis.yml
Outdated
- cd onigmo-6.2.0 | ||
- ./configure | ||
- make | ||
- sudo make install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also update the docs about how to install onigmo. Isn't there a more user-friendly way of installing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly I could not find any convenient way (like apt-get or brew), so I compiled from source. The good think - there is no dependencies, so it compiles smoothly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated a README, as well.
@ajnavarro, @erizocosmico - guys take a look into the next iteration. |
Didn't oniguruma use to segfault/panic in certain times? That's why we removed it. Was that fixed? If not, why are we adding this back again? |
The next step is to integrate it in gitbase. On gitbase only oniguruma will be available. We can think about |
Regarding #618 (comment) |
@kuba-- could you change the PR title please? It's a little bit misleading now. |
README.md
Outdated
make oniguruma # on linux you may need sudo | ||
``` | ||
|
||
If you want to use regex engine from go's standard library, you have to compile **go-mysql-server** with `--tags go` argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we change the tag to something more specific, like golang_regex_engine or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are a lot of possibilities that another library is using the same go
tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is a risk, so lets prefix it with mysql_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, mysql_go
is too broad, but maybe is the go way ;)
README.md
Outdated
``` | ||
|
||
If you want to use regex engine from go's standard library, you have to compile **go-mysql-server** with `--tags go` argument. | ||
Besides standard go's library and [oniguruma](github.com/kkos/oniguruma) the **go-mysql-server** also supports multiple engines originaly implemented in C. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove any other regex engine and focus on only one.
As @kuba says in #618 (comment) I believe it was fixed with the regexp Pool. |
@ajnavarro the build finally passed |
I would say to totally remove old engines. Fewer engines, less code to maintain. If we need them in the future we can go to the commit history and get them.
|
Signed-off-by: kuba-- <kuba@sourced.tech>
@ajnavarro - PTAL. The new tag is |
Signed-off-by: kuba-- <kuba@sourced.tech>
Updated after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for the go.mod file, that should be updated.
@kuba-- - it was just updated ( |
Signed-off-by: kuba-- kuba@sourced.tech
Closes #615
Integrate hyperscan as a new (default) regex engine.