title: How to prevent Vaadin 10 to loose connection when processing for a long time?
body: <p>I have a simple code, that imitate data processing after clicking a button:</p>
  
  <pre><code>@Route("long")
  public class LongWait extends VerticalLayout {
  
      public LongWait() {
          Button processButton = new Button("Process");
          processButton.addClickListener(event -&gt; process());
          add(processButton);
      }
  
      //imitates processing data: 
      //should sleep for 10 minutes and then add "finished" label
      //instead loose connection after 5 minutes
      private void process() {
          try {
              Thread.sleep(10 * 60 * 1000);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
          add(new Label("finished"));
      }
  }
  </code></pre>
  
  <p><br>The problem is - browser loose connection with server after 5 minutes of "processing".</p>
  
  <p><a href="https://i.stack.imgur.com/PXBt2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PXBt2.png" alt="vaadin loose server connection"></a></p>
  
  <p>Why is it happening and how to avoid it? <br> (I really have to process large amount of data.) <br> <br>
  Vaadin: 10.0.3 <br>
  Tomcat: 9.0.8 <br>
  Java: 1.8.0_162<br> <br></p>
  
  <p><strong>UPD:</strong>
  After <code>process()</code> method have finished it's work (10 minutes passed) I got following error in log:</p>
  
  <pre><code>java.lang.UnsupportedOperationException: Confirmed duplicate message from the client. Expected sync id: 1, got 0. Message start: {"csrfToken":"964b296a-b3ab-48d2-b67f-5e46080f8949","rpc":[{"type":"event","node":4,"event":"click","data":{"event.shiftKey":false,"event.metaKey":false,"event.detail":1,"event.ctrlKey":false,"event.clientX":75,"event.clientY":42,"event.altKey":false,"event.button":0,"event.screenY":160,"event.screenX":76}}],"syncId":0,"clientId":0}
      at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:302)
      at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:89)
      at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
      at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1487)
      at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:300)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>