SaurabhChawla100 opened a new pull request #29413:
URL: https://github.com/apache/spark/pull/29413
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR:
https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
7. If you want to add a new configuration, please read the guideline first
for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
-->
### What changes were proposed in this pull request?
There are scenarios where we have seen the event drop in spark, resulting
in the inconsistent state for the spark Application(some time application is
hung state).
For example - This can be due to the large number of parallel task
processing. Producer thread keeps on adding the events to the
Queue and Consumer thread is consuming the events at the slower rate compare
to the Producer adding in the queue. Resulting the
Queue to reach max size and events get dropped from that.
There are times if Queue Size would be little bit higher like 10 percent (or
20 percent) extra of the existing Queue size, the events
can be processed preventing the event drop at that point of time.
As per the current architecture size of event Queue can be configured at
start of the application by setting
spark.scheduler.listenerbus.eventqueue.capacity. Once this is set there is
fixed size event Queue(LinkedBlockingQueue), which cannot be changed
at run time to accommodate some extra events before dropping event from the
Queue
This Jira for adding a support of VariableLinkedBlockingQueue to tune the
dropping of the events.
VariableLinkedBlockingQueue ->
https://www.rabbitmq.com/releases/rabbitmq-java-client/v3.5.4/rabbitmq-java-client-javadoc-3.5.4/com/rabbitmq/client/impl/VariableLinkedBlockingQueue.html
### Why are the changes needed?
As the part of this PR, we can provide the support for
VariableLinkedBlockingQueue.
1) We need to add those Queue where we are seeing the event drop and add to
spark.set.optmized.event.queue.
set --conf spark.set.optmized.event.queue=appStatus,executorManagement ->
Now these two queues will be
VariableLinkedBlockingQueue and size of the queue can be increased at run
time.
By default its empty string so all the Queues will use the old behavior
LinkedBlockingQueue
2) We can set threshold of the size of the queue that we want to increase ->
spark.set.optmized.event.queue.threshold
Now if we use VariableLinkedBlockingQueue, at the time when the size of the
queue reach the size initialized at start of the job , Queue will try to
increase the size of the Queue to threshold
(spark.set.optmized.event.queue.threshold) and prevent the Event drop at that
point of time.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Added the Unit test and tested the functionality using the spark-submit
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]