Skip to content

Canceling a retrieval deal on the client can cause data transfer to get stuck in 'Ongoing' on the server side #1132

@jacobheun

Description

@jacobheun

Problem

Terminating a graphsync data transfer via the client aborting (ctrl+c) can result in the transfer not being properly terminated on Boosts end. This can eventually lead to timeouts on the client side for subsequent requests.

Info

Transport: Graphsync via Lassie

In the below screenshot, I ran 4 retrievals using https://github.com/filecoin-project/lassie and canceled all of them mid download. 3 of the 4 retrievals got stuck in the 'Ongoing' state.

lassie fetch --progress bafy...

image

The terminated data transfer event logs look like:

2023-01-26 15:50:01.443 |   | DT:Open | 
2023-01-26 15:50:01.443 | 0ms | Open | New |  
2023-01-26 15:50:01.446 | 3ms | DT:NewVoucherResult |   |  
2023-01-26 15:50:01.447 | 1ms | DT:Accept |   |  
2023-01-26 15:50:01.449 | 2ms | DealAccepted | Unsealing |  
2023-01-26 15:50:01.450 | 1ms | DT:PauseResponder |   |  
2023-01-26 15:50:01.807 | 357ms | DT:ResumeResponder |   |  
2023-01-26 15:50:01.807 | 0ms | UnsealComplete | Unsealed |  
2023-01-26 15:50:03.048 | 1s | DT:DataSent |   |  
2023-01-26 15:50:03.605 | 557ms | DT:DataSent |   |  
2023-01-26 15:50:04.899 | 1s | DT:DataSent


... (more data sent)
2023-01-26 15:52:28.445	655ms	DT:DataSent		
2023-01-26 15:52:29.114	669ms	DT:DataSent		
2023-01-26 15:52:29.321	207ms	DT:ReceiveDataError		stream reset
2023-01-26 15:52:29.324	3ms	DT:SendDataError		queue shutdown

The data transfer that was fully canceled, was actually a timeout termination by lassie because data was not sent for ~20s. The full event logs look like this:

2023-01-26 15:52:40.133		DT:Open		
2023-01-26 15:52:40.133	0ms	Open	New	
2023-01-26 15:52:40.136	3ms	DT:NewVoucherResult		
2023-01-26 15:52:40.137	1ms	DT:Accept		
2023-01-26 15:52:40.139	2ms	DealAccepted	Unsealing	
2023-01-26 15:52:40.140	1ms	DT:PauseResponder		
2023-01-26 15:52:40.536	396ms	DT:ResumeResponder		
2023-01-26 15:52:40.536	0ms	UnsealComplete	Unsealed	
2023-01-26 15:52:58.208	18s	DT:Cancel		
2023-01-26 15:52:58.211	3ms	ClientCancelled	Cancelling	Client cancelled retrieval
2023-01-26 15:52:58.212	1ms	DT:CleanupComplete		
2023-01-26 15:52:58.215	3ms	CancelComplete	Cancelled	Client cancelled retrieval

Refs

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions