-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add match results dialog #17
Conversation
This if far from functional, has trivial errors atm. |
144b04d
to
6144b31
Compare
Uh, I only skimmed it, (along with the first time), but this one should be merged only after match backend is inside, am i wrong ? |
You're right. It's far from being ready |
9d9c338
to
1247cd1
Compare
1247cd1
to
7e01c33
Compare
bb98f09
to
251eb05
Compare
8d25452
to
ce701f8
Compare
which proved to be quite slow
+ performance optimizations and some debugging Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Also, small refactor of QueryWorker and surrounding functions Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Replace delayed_query calls which potentially risked double starting a query worker (and hang). Replace delayed_worker calls with calling query worker's start method Simplify network delayed query interface Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
f669679
to
f0da7aa
Compare
Plus better exception logging Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
…caching them in MatchAction Signed-off-by: Nir Izraeli <nirizr@gmail.com>
…reshold is reached * Avoid exception and remove related exception handling code * Upload serialized instances when all functions were serialized but didn't reach upload threshold Signed-off-by: Nir Izraeli <nirizr@gmail.com>
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
f0da7aa
to
01b2da1
Compare
idaplugin/rematch/actions/match.py
Outdated
func = instances.FunctionInstance(self.file_version_id, offset) | ||
self.instance_set.append(func.serialize()) | ||
|
||
if len(self.instance_set) >= 100 or not self.functions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're comparing self.functions twice here, in different ways, the 2nd condition will never be met.
I don't understand this condition.
If there are no functions, return.
I also don't understand the actual condition of comparing the value to 100 and only
then uploading, what happens if there are 10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is this:
We should send objects to the server in two cases:
- We collected 100 instances, enough to send a request for. We'd like to consolidate multiple requests into few requests with decent size.
- If we just processed the last function (we
pop
ed the last one, andself.functions
just became empty). We need to make sure we won't "forget" the last items if they didn't reach the bulk-size.
I know this piece of code is a bit too difficult to understand. Any ideas on how to make it clearer?
I'll also comment it so it'll be clearer.
idaplugin/rematch/actions/match.py
Outdated
self.cancel_upload() | ||
self.clean() | ||
self.delayed_queries = [] | ||
|
||
self.start_task() | ||
|
||
def start_task(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm writing a note here but the note refers to something which is already in master.
the self.source variable does is incomplete in the conditions of 'range'and source_single.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow. Is there something to fix here? Is there something to fix for master? Would you like me to rebase again and you'll comment then?
@@ -171,24 +182,86 @@ def perform_task(self): | |||
progress = int(r['progress']) | |||
status = r['status'] | |||
if status == 'failed': | |||
self.pbar.reject() | |||
self.pbar.cancel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding some debugging or logging for a task which failed?
We'd most likely catch it earlier, but if anything is higher (nothing transport side), we'd miss it
and won't have all tasks synced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is quite big and not really logged. I'll add logging throughout the code. Good idea!
idaplugin/rematch/network.py
Outdated
if not self.paginate: | ||
break | ||
|
||
if 'next' not in response or not response['next']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the 2nd condition fail in case we get a str response? this should separated to list / dict and str
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.paginate
should be only true for json responses. For those response
is a dictionary (edit: or a list).
What do you think of a test to make sure self.json == True
and that response is a dictionary?
* more logs and a few additional comments * validate pagination network support Signed-off-by: Nir Izraeli <nirizr@gmail.com>
🎉 😀 🎉 |
Remaining tasks:
Convert MatchResultsDialog to a dock-able form.- CBA, not important enough.Signed-off-by: Nir Izraeli nirizr@gmail.com