Skip to content

P2P controller issues #25

@eldargab

Description

@eldargab

1

if !self.logs_storage.is_initialized() {

And the query is silently dropped? No good!

2

.unwrap_or_else(|_| error!("Cannot send query result: queue full"));

It is strange to ignore back pressure and to continue accept queries while there are troubles with sending them back!

Similar thing happens here:

warn!("Queries queue is full. Dropping query from {peer_id}");

When application is not able to process requests it should convey that to the transport level and to stop wasting resources on accepting and verifying packets that it is about to drop.

However, the problem is not just about queue puts.

I would implement request processing pipeline roughly as follows.

  • No queue in the message receiving loop
  • CU and MAX_PENDING_QUERIES limits are checked and the error is returned to the user immediately if they where exceeded (with await on response queue).
  • Query processing procedure would be launched with tokio::spawn() and would include
    1. Parsing
    2. Query execution
    3. Log record formulation and writing
    4. Send queue put with await.

3

query_str: String,

No need for ownership.

4

max query size limit in the currently linked version of the transport lib is set to 512 kb.

pub const MAX_QUERY_SIZE: u64 = 512 * 1024;

It should be less.

The limit for the query itself should be set exactly and explicitly to 256 kb.

Transport message size should be adjusted accordingly.

For the future, allocation check should happen before message arrival and validation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions