When Syncing source code starts, errors will interrupt the application program

The first question,When the source code starts, some errors will interrupt the application’s permission. I would like to understand the principle of error interrupt programs and how to solve them. The source code is as follows, the close() method

func (a *App) wait(errChan <-chan error) {
	err := <-errChan

	done := make(chan struct{})
	go func() {
	select {
	case <-done:
	case <-time.After(10 * time.Second):
		l.Warnln("Database failed to stop within 10s")



second question,The error log is as follows, which can also interrupt the application. Please analyze the cause of the problem and how to solve it。

[BIKPY] 2023/11/06 10:47:41 INFO: New NAT port mapping: external TCP address to local address [::]:22000.
[BIKPY] 2023/11/06 10:47:41 INFO: Detected 1 NAT service
[BIKPY] 2023/11/06 10:47:41 INFO: quic:// detected NAT type: Symmetric NAT
[BIKPY] 2023/11/06 10:48:35 INFO: QUIC listener ([::]:22000) shutting down
[BIKPY] 2023/11/06 10:48:35 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[BIKPY] 2023/11/06 10:48:35 INFO: Lost primary connection to JJPORRB at Syncthing is being stopped (0 remain)
[BIKPY] 2023/11/06 10:48:35 INFO: Connection to JJPORRB at closed: Syncthing is being stopped
[BIKPY] 2023/11/06 10:48:35 INFO: TCP listener ([::]:22000) shutting down
[BIKPY] 2023/11/06 10:48:35 INFO: Exiting

Syncthing exits when it receives a SIGTERM signal, which appears to be what happened in the second log trace. That might be sent by for example systemd if told to shut down or restart the service.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.