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 for multi agent job completion #282
Conversation
version: '3'
services:
web:
restart: always
build:
context: .
dockerfile: deploy/docker/web.Dockerfile
ports:
- "80:5000"
links:
- redis
depends_on:
- "redis"
- "daemon1"
- "daemon2"
- "ursadb1"
- "ursadb2"
daemon1:
restart: always
build:
context: .
dockerfile: deploy/docker/daemon.Dockerfile
command: dameon1
volumes:
- "/tmp/samples1:/mnt/samples"
depends_on:
- "redis"
- "ursadb1"
environment:
- "MQUERY_BACKEND=tcp://ursadb1:9281"
daemon2:
restart: always
build:
context: .
dockerfile: deploy/docker/daemon.Dockerfile
command: dameon2
volumes:
- "/tmp/samples2:/mnt/samples"
depends_on:
- "redis"
- "ursadb2"
environment:
- "MQUERY_BACKEND=tcp://ursadb2:9281"
ursadb1:
restart: always
image: mqueryci/ursadb:v1.5.0
ports:
- "127.0.0.1:5001:9281"
volumes:
- "/tmp/samples1:/mnt/samples"
- "/tmp/indexes1:/var/lib/ursadb"
ursadb2:
restart: always
image: mqueryci/ursadb:v1.5.0
ports:
- "127.0.0.1:5002:9281"
volumes:
- "/tmp/samples2:/mnt/samples"
- "/tmp/indexes2:/var/lib/ursadb"
redis:
restart: always
image: redis
old reproducttion config |
b6940cf
to
e0661c4
Compare
Confirmed and tested. Sorry for making everyone wait! I was taking time with this, because the old code used to work with my multi-cluster setup and I didn't want to accidentaly break something. I think it's ready for review. |
No, I was wrong, this did not fix the issue at all. I've tested with more agents and reproduced the issue. Pushed a new version of this PR. There are actually two issues:
Overall this would be much simpler using a relational DB, but current level of complexity was not expected when the first version of mquery was released 🤔 . There's always #74 but I fear that migration to another database would be a huge burden for everyone involved (especially me). Current data model is bad but workable after all 🤔 |
Co-authored-by: Michał Praszmo <michalpr@cert.pl>
Your checklist for this pull request
What is the current behaviour?
With multiple agents, jobs sometimes don't complete properly.
What is the new behaviour?
Jobs complete properly. I hope, at least.
This is a draft, because I need to set-up a proper mquery testing lab (again). Daemon is notoriously hard to reason about, and I really should test this code before the release.
This is related to PR #271, but I think this is a more correct solution - I'll explain "why" when I test this properly.
Test plan
Create a setup with multiple agent groups and ursadb, and run a single query there. It should complete properly in all cases (indepentent of how many samples are in each agent group)
Closing issues
fixes #270
fixes #301