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

Fix: random ParserException with routing rules engine #198

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

Conversation

regadas
Copy link

@regadas regadas commented Apr 27, 2023

I have seen random queries being submitted to the default adhoc cluster instead of the intended cluster.

After a closer look, there were actually some exceptions being thrown, i.e.

! org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping
! at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:572)
! at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingFirstKey.produce(ParserImpl.java:552)
! at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
! at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
! at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:235)
! at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162)
! at org.yaml.snakeyaml.composer.Composer.composeKeyNode(Composer.java:253)
! at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:244)
! at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236)
! at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162)
! at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:95)
! at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:134)
! at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:494)

The suspicion here is around reading/creating the rules on every request not being thread safe.

@baiyyidsn
Copy link

Hi regadas~, I encountered the same issue, and your code fix the problem, but also bring in another problem, such as the gateway can not dynamic load routing config file. And I just fixed it on my local repo

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.

None yet

2 participants