Closed ivchcm closed 1 year ago
First, Scratch
is not thread safe, please ensure you have right Scratch
for the concurrent scenes.
While the Hyperscan library is re-entrant, the use of scratch spaces is not. For example, if by design it is deemed necessary to run recursive or nested scanning (say, from the match callback function), then an additional scratch space is required for that context.
Can you reproduce your issue with a simple example? Thanks
We are using the Hyperscan on the high load system (up to 50k rps)
The version of the
gohs
lib is 1.1.0 OSUbuntu 20.04
libhyperscan5 5.2.1-1build1
For matching the patterns we use the VectorDatabase and on the local PC without any load (unit tests) everything works as expected But on the prod environment we're having an issue - for the
equals
match we're getting the false result on the completely correct string (double-checked with the simple regexp match) and for some reason, we're getting thetrue
match for the string, that we don't have in any of our patters.The code is smth like that:
And the scan is like
And I'm getting false results here (the match handler callback isn't called). Also, I'm getting the
true
result for the completely different input string. And what is more confusing - I'm getting thetrue
result for only one different string. For example: if I have string1, string2, string4, and string5 and patternequals
is created for the string1 I'm getting thetrue
match for string2 and never for any other string