bastion-rs / bastion

Highly-available Distributed Fault-tolerant Runtime

Home Page:https://www.bastion-rs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scaling Groups: UpperBound limit doesn't seem to behave as expected

o0Ignition0o opened this issue · comments

  • Version: Stable
  • Platform: Any
  • Subsystem: ?

str:

line 83: .with_upper_bound(UpperBound::Limit(2)) //From 10

line 110: Delay::new(Duration::from_millis(**number * 5000)).await; //From 500

line 120: println!( "[Processing] Worker #{:?} processed {} message(s) Total workers:{}", // Added Total workers ctx.current().id(), messages_received, ctx.parent().elems().len() );

expected output: 2 workers

actual output:

[Processing] Worker #BastionId(e067fcfd-489c-438a-81a7-e0d857c52018) processed 1 message(s) Total workers:7
[Processing] Worker #BastionId(e067fcfd-489c-438a-81a7-e0d857c52018) received 3
[Processing] Worker #BastionId(c28863b2-cf23-4ece-971b-7038687c7b17) processed 3 message(s) Total workers:2
[Processing] Worker #BastionId(c28863b2-cf23-4ece-971b-7038687c7b17) received 5
[Processing] Worker #BastionId(cf29af70-cb3c-4580-9c37-10f9d05ba5c3) processed 4 message(s) Total workers:4
[Processing] Worker #BastionId(cf29af70-cb3c-4580-9c37-10f9d05ba5c3) received 2
[Processing] Worker #BastionId(7e5cce0b-05b9-43e7-bb99-4ea2e8b846ce) processed 1 message(s) Total workers:3
[Processing] Worker #BastionId(7e5cce0b-05b9-43e7-bb99-4ea2e8b846ce) received 3
[Processing] Worker #BastionId(db9caeeb-5fb9-448d-9efb-9b6002765bba) received 1
[Processing] Worker #BastionId(78a7c236-7bfa-4a1f-8226-2be5c4840d3f) processed 2 message(s) Total workers:1
[Processing] Worker #BastionId(78a7c236-7bfa-4a1f-8226-2be5c4840d3f) received 5
[Processing] Worker started!
[Processing] Worker #BastionId(db9caeeb-5fb9-448d-9efb-9b6002765bba) processed 1 message(s) Total workers:8
[Processing] Worker #BastionId(db9caeeb-5fb9-448d-9efb-9b6002765bba) received 5
[Processing] Worker #BastionId(6c9602a5-64a7-49f9-8905-9b965fbc4206) received 5
[Processing] Worker #BastionId(cf29af70-cb3c-4580-9c37-10f9d05ba5c3) processed 5 message(s) Total workers:4
[Processing] Worker #BastionId(cf29af70-cb3c-4580-9c37-10f9d05ba5c3) received 4
[Processing] Worker #BastionId(1dd35104-28e1-41b2-9e41-434661c5b327) processed 3 message(s) Total workers:0
[Processing] Worker #BastionId(1dd35104-28e1-41b2-9e41-434661c5b327) received 2
[Processing] Worker #BastionId(5f7a1db4-b64b-4337-95bb-c3d033da7749) processed 1 message(s) Total workers:5

tried the above steps. Couldn't able to reproduce.

closing since it was a features misuse :)