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

Use separate parameters for short_context length and exit_message length #1617

Closed
spring-projects-issues opened this issue Mar 5, 2013 · 1 comment

Comments

@spring-projects-issues
Copy link
Collaborator

Sebastien Lorber opened BATCH-1978 and commented

Hello,

In my usecase we have Java stacktraces as Exit Message.
These stacktraces are currently truncated because of the default 2500 limit.
This is a problem because the important part to the stack (caused by) is at the end and, oftenly, it's truncated.

In org.springframework.batch.core.repository.support.JobRepositoryFactoryBean#setMaxVarCharLength
It would be nice to have the possibility to specify a distinct value for short_context and exit_message.
Because it is not a problem if short_context is truncated for me, but it is for exit_message.

As I'm going to increase that limit, I also need to update the MySQL schema for short_context, to avoir problems with the varchar(2500):
ALTER TABLE BATCH_JOB_EXECUTION MODIFY EXIT_MESSAGE TEXT;
ALTER TABLE BATCH_STEP_EXECUTION MODIFY EXIT_MESSAGE TEXT;
ALTER TABLE BATCH_STEP_EXECUTION_CONTEXT MODIFY SHORT_CONTEXT TEXT;
ALTER TABLE BATCH_JOB_EXECUTION_CONTEXT MODIFY SHORT_CONTEXT TEXT;

By the way, it would be nice to be able to deactivate the truncation, in case the engine can truncate the exit_message itself. In MySQL, the TEXT type will handle the truncation, so I can safely put MAX_INT as a limit in setMaxVarCharLength


Affects: 2.1.9

@spring-projects-issues
Copy link
Collaborator Author

Mahmoud Ben Hassine commented

Hi,

I do confirm, the maxVarCharLength is used for both exitMessageLength and shortContextLength. When increased to a high value to support long stack traces, we would allocate more space than needed for the shortContext, which is obviously wasteful. So the suggested improvement makes sense to me. Thank you for this suggestion!

You are welcome to open a PR on github and we will consider merging it in a future version.

Kr,
Mahmoud

@fmbenhassine fmbenhassine removed the status: waiting-for-triage Issues that we did not analyse yet label Oct 12, 2022
@fmbenhassine fmbenhassine added this to the 5.1.0 milestone Oct 12, 2022
fmbenhassine added a commit to fmbenhassine/spring-batch that referenced this issue Oct 12, 2022
@fmbenhassine fmbenhassine changed the title Decorelate short_context and exit_message size/truncation in DB storage [BATCH-1978] Use separate parameters for short_context length and exit_message length Oct 12, 2022
@fmbenhassine fmbenhassine modified the milestones: 5.1.0, 5.1.0-M3 Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants