2023-06-13 04:40:19.529 INFO [pool 1] Created
2023-06-13 04:40:19.529 INFO [router 1] Created {context: map[address:localhost:7687]}
2023-06-13 04:40:19.529 INFO [driver 1] Created { target: localhost:7687 }
2023-06-13 04:40:19.529 INFO [router 1] Reading routing table from initial router: localhost:7687
2023-06-13 04:40:19.529 INFO [pool 1] Connecting to localhost:7687
2023-06-13 04:40:19.533 INFO [bolt5 bolt-14@localhost:7687] Connected
2023-06-13 04:40:19.533 INFO [bolt5 bolt-14@localhost:7687] Retrieving routing table
2023-06-13 04:40:19.535 INFO [bolt5 bolt-14@localhost:7687] Close
2023-06-13 04:40:19.535 INFO [pool 1] Closed
2023-06-13 04:40:19.535 INFO [driver 1] Closed
2023-06-13 04:40:19.535 INFO [driver 1] Closed
2023-06-13 04:40:19.535 INFO [driver 1] Closed
i.e. you can call Driver.Close() as many times as you wish and logging tells you that you have closed it multiple times. In truth, the driver is checking whether the pool is already closed, and in that case not doing anything, except setting to nil a var which already is so and outputting to log.
This PR changes this behavior so that multiple calls to Driver.Close() are silently ignored.
I was surprised that calling
Driver.close()
twice didn't raise any errors, so I dag a bit.Currently, this code
results in this output
i.e. you can call
Driver.Close()
as many times as you wish and logging tells you that you have closed it multiple times. In truth, the driver is checking whether the pool is already closed, and in that case not doing anything, except setting tonil
a var which already is so and outputting to log.This PR changes this behavior so that multiple calls to
Driver.Close()
are silently ignored.