regexp2 icon indicating copy to clipboard operation
regexp2 copied to clipboard

fix Incorrect timeout error when using FindStringMatch()

Open Brinenas opened this issue 1 year ago • 4 comments

fix Timeout Error issue: when the fastclock stop running, then next matches will get a wrong fast.current and daeline, thus trigger an incorrect timeout error.

Brinenas avatar Aug 21 '24 09:08 Brinenas

Add a new UT, If you comment the add code, the ut will failed.

Brinenas avatar Aug 21 '24 10:08 Brinenas

Thanks for submitting this. Can you add an integration-level test showing the behavior fix from the API consumer perspective?

dlclark avatar Aug 21 '24 14:08 dlclark

Add a new UT for my own case. Maybe you guys can add a more elegant test.

Brinenas avatar Aug 22 '24 02:08 Brinenas

@Brinenas a couple issues I see:

  • fast.running and fast.start are protected by fast.mu for read/write, so we can't access them without getting the lock
  • I don't think we want to get that lock every time we need to make a deadline because this is an edge case. I've refactored the code to only do this if we already know the deadline needs to be extended.

I did a couple other small tweaks to the test as well. Let me know if you see any issues with my change.

dlclark avatar Aug 23 '24 19:08 dlclark

This change fixed a similar issue for me - intermittent false timeouts seemingly triggered by a large volume of sequential regex matching that appeared after the inclusion of the fast clock back in v1.8.0. Appreciate theres probably a lot of other stuff on your plate but was wondering when we might be able to expect a new tagged release including this fix? Thanks for the effort on resolving this! <3

bradrevans avatar Feb 11 '25 11:02 bradrevans

@bradrevans this is done.

dlclark avatar Feb 11 '25 18:02 dlclark

@bradrevans this is done.

Ah. Thanks!

bradrevans avatar Feb 11 '25 19:02 bradrevans