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 parsing of empty matchobject fields by the redis PB marshaling/unmarshaling code #51

Closed
joeholley opened this issue Dec 21, 2018 · 1 comment
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@joeholley
Copy link
Collaborator

This is a benign error (no effect on running OM) but it can be misleading and is pretty spammy :/

msg="invalid character '}' looking for beginning of value" app=openmatch caller=internal/statestorage/redis/redispb/redispb.go cmd=HGETALL component=statestorage key=a2be9dbd0cc04367a06c0f4bea46baea.testprofilev1
@joeholley joeholley self-assigned this Dec 21, 2018
@joeholley joeholley added the kind/bug Something isn't working label Dec 21, 2018
@ihrankouski
Copy link
Contributor

ihrankouski commented Dec 22, 2018

These errors are coming from two places:

One case when errors happen there is when pbMap doesn't have a key: Sprintf'ed string will not be valid JSON then.

While working on this I noticed weird issue at first sight: Wrapping these places with error checks makes Backend API to start sending an empty MatchObject in a response to profile without "rosters" field set. After some debugging I think there's a bug in this same function that breaks Watcher:

  • When Evaluator approves proposal it renames the key in Redis.
  • To detect a fact of proposal approval the Backend's Watcher periodically calls UnmarshalFromRedis() which sends HGETALL under hood.
  • According to Redis docs HGETALL returns empty list when key does not exist, and Redigo seem to not treat empty list as error. And this breaks the logic of Watcher's work since UnmarshalFromRedis() doesn't check for results' length. (It was working previously because of this "invalid character '}'" JSON bug which caused UnmarshalFromRedis() to return error making Watcher think that there's not results yet)

ihrankouski pushed a commit to ihrankouski/open-match that referenced this issue Dec 22, 2018
@Laremere Laremere added this to the v0.3.0 milestone Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants