The International Simutrans Forum

 

Author Topic: Bug: Near infinite local mail traffic between 2 stops.  (Read 1094 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Bug: Near infinite local mail traffic between 2 stops.
« on: June 13, 2018, 12:59:33 AM »
On the server game I am noticing a huge amount of local (within same city) mail at Chatingfield (@5348,2600). Between the port and the single internal mail stop there is in excess of 1,000 units of mail being generated per month. The port is serviced by mail from a huge mail network, however that is only a few dozen units per month comming in and out. Most of the mail traffic for the city is being generated within the city itself between those two stops. The amount of mail is not trivial either, it is exceeding 1,330 units transported per month.

I am purposely trying to leave this line in such a state. I have made some modifications to try and increase storage capacity on either side but hopefully these will not stop the problem from occurring.
« Last Edit: July 31, 2018, 04:03:15 AM by DrSuperGood »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Huge local mail traffic
« Reply #1 on: July 14, 2018, 07:05:39 AM »
Still happening on the server. Last I checked was 1520 mail per month between the stops. I am checking if I can push that up to 2k or more.

I have however changed involved rolling stock due to financial reasons. I do apologize if this interfered with the bug.

EDIT: Line is now pushing over 3k units of mail per month between the two stops that are only 3km apart.
It seems that the mail is respawning almost immediately upon delivery, so the only thing limiting the amount of mail that can be transported between the stops per month is the speed of vehicles used. Something is seriously broken here as it should not take 3 full capacity mail trucks moving mail 3km.

I have put 4 trucks on the route for a theoretical capacity of 8,960 mail per month (64 time slots of 70 mail with 2 stops) to test. So far it is scheduled to be in excess of 6k mail between the two stops per month.

EDIT2: Currently over 6,000 mail moved in a single month between the stops. Scheduled to exceed 7,000 easily by end of month and possibly even around 8,000.

EDIT3: Line finished the month transporting 8,483 mail.
« Last Edit: July 14, 2018, 09:37:09 AM by DrSuperGood »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #2 on: July 15, 2018, 09:16:13 AM »
This is being caused by a serious bug with the mail delivery system. The mail is global mail that was generated correctly from around the map towards the Chatingfield Manor House @5331,2581. The mail correctly routed its way to Chatingfield via my network, some of it even coming from other player's networks. The mail however cannot be delivered to the Chatingfield Manor House for some reason, possibly because the only mail stop servicing the manor only covers half of it in its catchment area. As a result the mail is repeatedly bounced between the two stops trying to get to the manor. Over decades of collection the mail has built up such that there is approximatly 250 units of undeliverable mail which I can move around in a line capable of moving 8,000 units per month and get paid for each time the mail is moved.

Looking at the detail window of the Chatingfield Manor House it appears that the only mail stop it is connected to is Chatingfield Parish Hall Stop. The Chatingfield Parish Hall Stop is not serviced by any lines, and serves as a walking passenger catchment extender for the dock. A catchment extender is a passenger capable unserved stop that is placed in the catchment range a served stop to extend the catchment area of walking passengers by allowing them to first walk to the catchment extender stop and then transfer from the catchment extender stop to the served stop. Both stops involved in this bug are technically connected to the same passenger extender, however this should only apply to passengers as mail cannot walk by itself.

The dock, Chatingfield Fields dock, is nowhere near the Manor House. However the other stop the mail is being sent to, Chatingfield City Walls Stop, technically half serves the Manor House as it covers 2/4 of the Manor House tiles. However as far as the Manor House is concerned Chatingfield City Walls Stop is not connected to it for mail. As such I suspect the bug is that mail is being generated towards Chatingfield City Walls Stop as the Manor House is partly in its catchment area but Chatingfield City Walls Stop cannot deliver the mail to the Manor House as it is not connected to it so instead tries to route it to its destination. It looks up the routing tables and sees that the dock knows where to forward it so sends it back to the dock.

This is a typical cycling routing problem. Packets are being bounced between nodes A and B infinitely because node A knows the destination is B but B is not the destination. Node B gets the packet which it cannot deliver, so forwards it on to A as A knows where to forward it on to its destination.

I think the correct behaviour in this case is that the Manor House should have no mail generated to/from it because it is technically not connected to any stops that are connected to a mail network. These packets that are bouncing around infinitly should not have been created in the first place as technically the Manor House is not mail serviced so no mail should be heading towards it. These mail packets should naturally decay as they become unrouteable due to their destination not being served.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #3 on: July 15, 2018, 10:21:09 AM »
Thank you for the analysis, and apologies for not having had the time to look into this previously. Trying to find the cause of this sort of problem on a saved game as large as the server game using the debugger is difficult in the extreme because of the extremely slow performance of such a large map when run in a debugger. For this reason, I have preferred to deal with the signalling issues first, not least because they had more impact, whereas this appears to be a more isolated issue.

However, the analysis in the preceding post gives a good indication of where the problem might arise. What would be very helpful is if you could conduct a test consisting of removing the "catchment area extender stop" (which is an exploit, although it is difficult to imagine any workable system to prevent this at present) and see whether the excess mail does disappear or not.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #4 on: July 15, 2018, 07:10:59 PM »
Quote
(which is an exploit, although it is difficult to imagine any workable system to prevent this at present)
This is an opinion. In real life some people used to walk for hours (not just at most 40 minutes) to get to train stations. People still do in remote places like India. Hence I do not see it really as an exploit but rather getting around technical limitations that there should be no walking distance limitation to a stop other than maximum journey time but there has to be one for computational complexity reasons. Walking people do not pay you to walk hence it is of no benefit if they end up choosing to walk to their destination if you provided the means.
Quote
and see whether the excess mail does disappear or not.
Will do. EDIT: or not because the server just crashed when I joined? I desynced near instantly... Will try again.

EDIT2: Done, waiting for results.

EDIT3: So far no difference at all. The manor does not even say it is connected to a mail stop anymore but the mail keeps bouncing around, I will try reloading the server (rejoin) to see if it makes a difference.

EDIT4: So far no difference...

EDIT5: Ran the game for a good part of half an hour and the mail still exists. The manor says nothing is connected to it. I do not know if any more mail is being generated to the manor but existing mail is not expiring due to no routing.
« Last Edit: July 15, 2018, 07:52:26 PM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #5 on: July 15, 2018, 10:59:13 PM »
Thank you for testing. This does seem to be potentially somewhat complex. Does the mail consistently "bounce" (as you put it) between two specific stops? If so, may I ask which ones?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #6 on: July 16, 2018, 05:12:37 AM »
Just checked the server again and it still is bouncing around after several months of removing the range extender stop.
Quote
Does the mail consistently "bounce" (as you put it) between two specific stops?
Yes. It infinitely bounces between the two stops I mentioned. Currently at a rate of ~9,000 trips per month limited only by convoy speed, capacity and loading time.
Quote
If so, may I ask which ones?
I mentioned them already...

The two stops are:
  • Dock not covering the manor: Chatingfield Fields dock.
  • Stop half covering but not connected to the manor: Chatingfield City Walls Stop
The line between them was originally operated by a mail boy (pony). I upgraded it to a horse drawn mail cart. Now it is 4 dedicated mail trucks running at full capacity.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #7 on: July 23, 2018, 03:28:47 PM »
Just found another occurrence of this on the server game.
  • Mail is being generated targeting the Vegetable farm @5030,2733 in/near Gossand.
  • Vegetable Farm is partly covered by Gossand Fields dock, which one can assume is the intended destination. In fact out of the 2 tiles that make up a Vegetable Farm structure only @5031,2733 is covered, with @5030,2733 where the mail is destined not being covered. The stop cannot deliver mail to the Vegetable Farm so routes it further on.
  • Mail bounces back to Gossand Corner dock where international mail enters the local network. This stop forwards such mail to Gossand Fields dock hence causing it to bounce between the stops and accumulate infinitely.
  • Quantity of mail currently bouncing around between the stops is anywhere from 400 to 800 units.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #8 on: July 29, 2018, 10:25:24 PM »
Thank you very much for these further details: that is most helpful. I think that I have now managed to fix this - I should be grateful if you could re-test with the next nightly build.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #9 on: July 30, 2018, 09:05:25 PM »
Appears fixed. From 10,000 mail per month down to a more appropriate 20. All the bouncing mail is gone.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Near infinite local mail traffic between 2 stops.
« Reply #10 on: July 30, 2018, 09:10:39 PM »
Excellent, thank you for confirming.