Skip to content

Fixing issue with Push stopping working in some circumstances - #11791

Merged
TatuLund merged 3 commits into
masterfrom
fix7719
Nov 5, 2019
Merged

TatuLund merged 3 commits into
masterfrom
fix7719

Conversation

@TatuLund

@TatuLund TatuLund commented Nov 5, 2019 •

Copy link
Copy Markdown
Contributor

If new request is attempted when resynchronization is ongoing, the Push will stop working. This patch fixes the issue by aborting handleJson if resynch is already ongoing.

This PR supercedes #11786

Fixes #11702, #7719


This change is Reviewable

If new request is attempted when resynchronization is ongoing, the Push will stop working. This patch fixes the issue by aborting handleJson if resynch is already ongoing. 

This PR supercedes #11786

Fixes #11702, #7719
@Ansku

Ansku commented Nov 5, 2019

Copy link
Copy Markdown
Member

client/src/main/java/com/vaadin/client/communication/MessageHandler.java, line 262 at r1 (raw file):

isResynchronize(json)

Could be saved into a variable instead of being called twice in a row when dropping the request is not needed. It's not a very cumbersome call but personally I'd still prefer not repeating it.

@TatuLund TatuLund left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @Ansku)


client/src/main/java/com/vaadin/client/communication/MessageHandler.java, line 262 at r1 (raw file):

Previously, Ansku (Anna Koskinen) wrote…
isResynchronize(json)

Could be saved into a variable instead of being called twice in a row when dropping the request is not needed. It's not a very cumbersome call but personally I'd still prefer not repeating it.

Done

@Ansku Ansku left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@TatuLund
TatuLund merged commit fd1a8df into master Nov 5, 2019
@Ansku
Ansku deleted the fix7719 branch November 5, 2019 14:28
Ansku pushed a commit that referenced this pull request Nov 6, 2019
* Fixing issue with Push stopping working in some circumstances

If new request is attempted when resynchronization is ongoing, the Push will stop working. This patch fixes the issue by aborting handleJson if resynch is already ongoing. 

This PR supercedes #11786

Fixes #11702, #7719

* Call onResynchronize() in MessageHandler

* Optimizing
Ansku added a commit that referenced this pull request Nov 6, 2019
#11795)

* Fixing issue with Push stopping working in some circumstances

If new request is attempted when resynchronization is ongoing, the Push will stop working. This patch fixes the issue by aborting handleJson if resynch is already ongoing.

Fixes #11702, #7719
TatuLund added a commit that referenced this pull request Nov 8, 2019
Ansku pushed a commit that referenced this pull request Nov 11, 2019
* Cherry pick PR #11791 from Vaadin 8

See: #11791
joheriks pushed a commit to vaadin/flow that referenced this pull request Mar 17, 2020
joheriks pushed a commit to vaadin/flow that referenced this pull request Mar 17, 2020
WipeAir pushed a commit to aditosoftware/framework that referenced this pull request Jun 2, 2020
mshabarov pushed a commit to vaadin/flow that referenced this pull request May 19, 2022
…13733)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve
vaadin-bot pushed a commit to vaadin/flow that referenced this pull request May 19, 2022
…13733)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve
vaadin-bot pushed a commit to vaadin/flow that referenced this pull request May 19, 2022
…13733)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve
vaadin-bot pushed a commit to vaadin/flow that referenced this pull request May 19, 2022
…13733)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve
mshabarov pushed a commit to vaadin/flow that referenced this pull request May 19, 2022
…13733) (#13806)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve

Co-authored-by: Tatu Lund <tatu@vaadin.com>
Co-authored-by: Artur <artur@vaadin.com>
mshabarov pushed a commit to vaadin/flow that referenced this pull request May 19, 2022
…13733) (#13804)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve

Co-authored-by: Tatu Lund <tatu@vaadin.com>
Co-authored-by: Artur <artur@vaadin.com>
mshabarov pushed a commit to vaadin/flow that referenced this pull request May 20, 2022
…13733) (#13805)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve

Co-authored-by: Tatu Lund <tatu@vaadin.com>
Co-authored-by: Artur <artur@vaadin.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 23.1.0.rc2 and is also targeting the upcoming stable 23.1.0 version.

mshabarov pushed a commit to vaadin/flow that referenced this pull request Jun 10, 2022
…13733) (#13805)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve

Co-authored-by: Tatu Lund <tatu@vaadin.com>
Co-authored-by: Artur <artur@vaadin.com>
taefi pushed a commit to vaadin/flow that referenced this pull request Jun 10, 2022
…13733) (#13805)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve

Co-authored-by: Tatu Lund <tatu@vaadin.com>
Co-authored-by: Artur <artur@vaadin.com>
ZheSun88 pushed a commit to vaadin/flow that referenced this pull request Sep 21, 2022
…13733)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve
mshabarov pushed a commit to vaadin/flow that referenced this pull request Sep 22, 2022
…13733)

Process re-sync messages via normal message queue and use semaphore to protect re-sync process (i.e. do not allow other messages while performing re-sync).

This PR is adopted from similar fixes for Vaadin 8.

vaadin/framework#11791
vaadin/framework#12043
vaadin/framework#12178

This also changes the method `forceMessageHandling` in a way that the desire to resynchronise is registered before calling `endRequest`. If this is not done, `endRequest` may end up sending out a request itself and that then causes the re-sync request to fail because a request is already in flight. This ends up throwing an IllegalStateException at com/vaadin/client/communication/RequestResponseTracker.java.

Fixes #13726

Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Pepijn Van Eeckhoudt @pepijnve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Push with websockets fails after reconnecting.

3 participants