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

Mongoengine seems to cache --move-hosts actions until quads-server bounced #234

Closed
sadsfae opened this issue Apr 16, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@sadsfae
Copy link
Member

commented Apr 16, 2019

We still have a strange behavior in that after entering scheduling actions --move-hosts show nothing to do but when quads-server is bounced it picks up the results.

This we thought was the fix but it still occurs, we should probably revert this until we can figure out where this is getting cached:

efc0fa9

For now, a mitigation for this is to simply issue systemctl restart quads-server after a new future schedule is entered.

@sadsfae sadsfae added this to the 1.1.0 milestone Apr 16, 2019

@sadsfae sadsfae added the Priority label May 10, 2019

@grafuls

This comment has been minimized.

Copy link
Contributor

commented May 13, 2019

sadsfae pushed a commit that referenced this issue May 13, 2019

Added config params for no caching
In general, GET responses are cached and, if another request arrives
for the same resource, the caching Tool will return 304 Not Modified
if possible, or serve the cached response otherwise.

Fixes: #234
Change-Id: I2d857fe6a79f28b5a12c43c2bfe969a799190830
@sadsfae

This comment has been minimized.

Copy link
Member Author

commented May 14, 2019

Not really sure where/how to debug this, it only appears to happen when the --move-hosts functionality is called.

https://github.com/redhat-performance/quads/blob/master/bin/quads-cli#L302

When other data is added/updated into MongoDB via Mongoengine ORM it can be queried immediately and reports back accurately.

We run this functionality out of cron currently, so every 5minutes if systems were set to either be moved somewhere else (or reclaimed) it'll pick up on it.

*/5 * * * * flock -n /tmp/moveandrebuild.lock -c "/opt/quads/bin/quads-cli --move-hosts" 1>>/var/log/move-and-rebuild.log 2>&1

@radez have you ever seen this kind of behavior?

@grafuls

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

sadsfae pushed a commit that referenced this issue May 15, 2019

Final fix for mongoengine cache.
Python’s default arguments are evaluated once when the function is
 defined, not each time the function is called. This means that if
 a default argument like date=datetime.now is defined the date will
 not be updated with any subsequent calls to that function.

Fixes: #234
Change-Id: I2cb72d99220ae3d09fa2e6657cfd2879bb000c42

@sadsfae sadsfae closed this May 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.