cap max creation time used in ranking calculation #630
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
added a cap on creation timestamp used in ranking calculation to not exceeds the current time while performing calculation to cope with posts' that have funny created date far into the future, also cap the final score value to not exceed int32 max size (
2**31 - 1
)the current ranking function involves using the posts' object creation timestamp as part of the calculation, but if the datetime is too far in the future (e.g. 4200-06-09, as seen in this example), it can cause the ranking score value to exceeds the ranking score field size, which appears to be int32 sized
technically we'll still be running into year 2038 problem on this field, but there's some discussion on adjusting the ranking score and keep that below int32 sized altogether, so that's left for the future exercise
also see #622 for more context, this only deals with a specific problem that's observed from that issue but by no means a definitive solution for the problem