Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeouts in session closing and closed reminders #5999 #6001

Merged
merged 5 commits into from Aug 19, 2016

Conversation

wkurniawan07
Copy link
Member

Fixes #5999

Still running some tests (in particular for checking backward-compatibility), but feel free to review what's already here.

@wkurniawan07 wkurniawan07 added the s.ToReview The PR is waiting for review(s) label Aug 18, 2016
Query q = getPm().newQuery(FeedbackSession.class);
q.declareParameters("boolean sentParam, boolean enableParam, Enum notTypeParam");
q.setFilter("sentClosedEmail == sentParam && isClosedEmailEnabled == enableParam "
+ "&& feedbackSessionType != notTypeParam");
Copy link
Contributor

@damithc damithc Aug 18, 2016

Choose a reason for hiding this comment

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

We can't filter by closing time?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not that trivial. A lot of matters need to be considered, one of which is timezone.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right, forgot about that when I was proposing solution 1 😛

Copy link
Contributor

Choose a reason for hiding this comment

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

We can ignore the timezone. Just get the sessions having closing times within last 48 hours. This should bring down the result set to less than a hundred instead of 13k.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a new a attribute is a lot more complicated as it needs to be kept consistent when the session deadlines are changed. Furthermore, there is a risk that we'll end up sending the reminder repeatedly if something goes wrong with setting the flag. I don't mind doing it if it can be done in a fool proof way, but I think the quickest solution is to narrow down the result set into last 48 hours.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's already done the foolproof way. If not, then something is also wrong with how we manage the opening and published emails.

@wkurniawan07 wkurniawan07 added this to the V5.87.01 milestone Aug 18, 2016
@chowyb
Copy link
Contributor

chowyb commented Aug 18, 2016

Looks okay now 👍

@chowyb chowyb added s.FinalReview The PR is ready for final review and removed s.ToReview The PR is waiting for review(s) labels Aug 18, 2016
@damithc damithc added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging and removed s.FinalReview The PR is ready for final review labels Aug 19, 2016
@damithc
Copy link
Contributor

damithc commented Aug 19, 2016

Can merge. Should have pinged me earlier.

@wkurniawan07 wkurniawan07 merged commit 2a67b0a into release Aug 19, 2016
@wkurniawan07 wkurniawan07 deleted the 5999-timeout-closing-email-reminder branch August 19, 2016 15:47
@wkurniawan07
Copy link
Member Author

Released as V5.87.01.
The script added in this PR should be run asap.

@damithc
Copy link
Contributor

damithc commented Aug 20, 2016

What's the behavior for legacy data? e.g. during the brief period of data migration

@damithc
Copy link
Contributor

damithc commented Aug 20, 2016

Also, should I deploy first and then run script or the other way around?
For future reference, a script should have "sufficient" verbosity over big data sets. If it prints out something for each entity, that's too much (we have 13k entities). Printing a message after each 100 or 1000 entities is more a better level of verbosity.

@damithc
Copy link
Contributor

damithc commented Aug 20, 2016

Another thing: shouldn't we migrate all sessions, not just non-private ones? I think private ones can become non-private if the user changes the flag.

@damithc
Copy link
Contributor

damithc commented Aug 20, 2016

Waiting for some clarification before deployment.

@damithc
Copy link
Contributor

damithc commented Aug 20, 2016

Migrating in progress. Sometimes migration scripts timeout in the middle due to server dropping the connection. That's why migration scripts should be able to run repeatedly and should be able to skip the entities already migrated.

@wkurniawan07
Copy link
Member Author

Noted. Apologies for that, this was only my second time writing client script (the first one being the course timezone field).

@damithc
Copy link
Contributor

damithc commented Aug 20, 2016

We'll probably need to document client script guidelines somewhere. At the moment they are just passed down by word-of-mouth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants