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

random scan_id not random enough #66

Closed
courtneycouch opened this issue Jun 23, 2015 · 4 comments
Closed

random scan_id not random enough #66

courtneycouch opened this issue Jun 23, 2015 · 4 comments

Comments

@courtneycouch
Copy link

If this:

data->scan_id = 0;
int32_t dummy_id = 0;
srand(time(NULL));
dummy_id = rand();
data->scan_id = dummy_id;

gets hit more than once in a second then the scan_id gets duplicated and you end up with errors like:

WARNING (scan): (thr_tscan.c::807) not starting scan 1926250993 because rchash_put() failed with error -4

It's not likely to happen in production but for pre-deployment testing it's possible for scans to happen very close together (as fast as tests complete). So we're finding we have to put these silly 1 second delays to keep scan_id collisions from happening.

@GayathriKaliyamoorthy
Copy link
Contributor

Hi,

We do not expect multiple requests for full system scan within a second. If you have such requirements, we can enhance the API, to accept scanID from the application. You can raise a pull request with the enhancements. We accept pull requests. :)

Thanks.

@tracker1
Copy link

tracker1 commented Jul 4, 2015

I'm not familiar with the internals, but if the scanID isn't sequential, why isn't crypto randomBytes, or the uuid module not used?

@wchu-citrusleaf
Copy link
Contributor

We will be fixing this shortly

@GayathriKaliyamoorthy
Copy link
Contributor

Fix is available from release 1.0.49.

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

No branches or pull requests

4 participants