ObjectDisposedException once in a while
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 4.4k
- Forks
- 993
- Merge medio
- 9 d 21 h
- PR fusionados (30 d)
- 1
Descripción
We are seeing ObjectDisposedExceptions once in a while:
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.ObjectDisposedException
bei System.Net.Sockets.Socket.AcceptAsync(System.Net.Sockets.SocketAsyncEventArgs)
bei Renci.SshNet.ForwardedPortLocal.StartAccept(System.Net.Sockets.SocketAsyncEventArgs)
bei Renci.SshNet.ForwardedPortLocal.AcceptCompleted(System.Object, System.Net.Sockets.SocketAsyncEventArgs)
bei System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs)
bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
bei System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(System.Net.Sockets.SocketError, Int32, System.Net.Sockets.SocketFlags)
bei System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
bei System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
These exceptions should be prevented in SSH.Net by catching the exception and ignoring it if the status is Stopped or Stopping. The status is set to Stopping before the _listener is disposed.
However, the status is checked for Stopped twice, instead of Stopping or Stopped. This is a simple oversight.
Same thing in ForwardedPortDynamic.NET.cs
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en src/Renci.SshNet/ForwardedPortLocal.NET.cs, en StartAccept, e inspecciona la comprobación de estado alrededor de la liberación del listener; después compara la lógica correspondiente en ForwardedPortDynamic.NET.cs. Reproduce o analiza una finalización de accept durante el apagado; se considera terminado cuando se evitan las instancias de ObjectDisposedException durante el apagado en ambas implementaciones de forwarded-port.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- networking
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100